<s> import numpy as np <EOL> from decoder_utils import load_data , load_nnet , decode , int_to_char , collapse_seq , load_char_map <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> print '<STR_LIT>' <EOL> fnum = <NUM_LIT:1> <EOL> data_dict , alis , keys = load_data ( fnum ) <EOL> print '<STR_LIT>' <EOL> rnn = load_nnet ( ) <EOL> data , labels = data_dict [ keys [ <NUM_LIT:0> ] ] , np . array ( alis [ keys [ <NUM_LIT:0> ] ] , <EOL> dtype = np . int32 ) <EOL> probs = rnn . costAndGrad ( data , labels ) <EOL> probs = np . log ( probs . astype ( np . float64 ) + <NUM_LIT> ) <EOL> hyp , hypScore , refScore = decode ( probs , <EOL> alpha = <NUM_LIT:1.0> , beta = <NUM_LIT:0.0> , beam = <NUM_LIT:200> , method = '<STR_LIT>' ) <EOL> char_map = load_char_map ( ) <EOL> if labels is not None : <EOL> print '<STR_LIT>' , collapse_seq ( int_to_char ( labels , char_map ) ) <EOL> print '<STR_LIT>' , collapse_seq ( int_to_char ( hyp , char_map ) ) <EOL> print '<STR_LIT>' , hypScore </s>
