Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias alias Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str keyword ListLoad Str Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword Num keyword Num If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad keyword Call NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad keyword Call NameLoad orelse Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad keyword Call NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad keyword Call NameLoad Assign NameStore ListLoad NameLoad NameLoad Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Call NameLoad Assign NameStore Call NameLoad keyword Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad Call NameLoad Num AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Num attr NameLoad attr Num Num Num Assign NameStore Call AttributeLoad CompareEq NameLoad AttributeLoad NameLoad attr attr Print BinOpMod Str BinOpMult BinOpSub Num NameLoad Num
N/A N/A 
Example that trains an LSTM or GRU based recurrent networks.
The dataset uses Penn Treebank dataset parsing on character-level.

Reference:
    Andrej Karpathy's char-rnn `[Karpathy]`_
.. _[Karpathy]: http://github.com/karpathy/char-rnn
 neon.backends gen_backend neon.data.text Text neon.data.dataloaders load_ptb_train load_ptb_test neon.initializers Uniform neon.layers GeneralizedCost LSTM Affine GRU neon.models Model neon.optimizers RMSProp Schedule neon.transforms Logistic Tanh Softmax CrossEntropyMulti neon.callbacks.callbacks Callbacks neon.util.argparser NeonArgparser extract_valid_args N/A parser N/A NeonArgparser __doc__ N/A N/A N/A parser add_argument --rlayer_type default lstm choices N/A gru lstm help type of recurrent layer to use (gru or lstm) N/A args N/A N/A parser parse_args gen_be False N/A N/A args batch_size 64 N/A time_steps 50 N/A hidden_size 128 N/A gradient_clip_value 5 N/A be N/A gen_backend N/A extract_valid_args args gen_backend N/A train_path N/A load_ptb_train path N/A args data_dir N/A valid_path N/A load_ptb_test path N/A args data_dir N/A train_set N/A Text time_steps train_path N/A valid_set N/A Text time_steps valid_path vocab N/A train_set vocab N/A init N/A Uniform low -0.08 high 0.08 N/A N/A N/A args rlayer_type lstm N/A N/A rlayer1 N/A LSTM hidden_size init activation N/A Tanh gate_activation N/A Logistic N/A rlayer2 N/A LSTM hidden_size init activation N/A Tanh gate_activation N/A Logistic N/A N/A rlayer1 N/A GRU hidden_size init activation N/A Tanh gate_activation N/A Logistic N/A rlayer2 N/A GRU hidden_size init activation N/A Tanh gate_activation N/A Logistic N/A layers N/A rlayer1 rlayer2 N/A Affine N/A len N/A train_set vocab init bias init activation N/A Softmax N/A cost N/A GeneralizedCost costfunc N/A CrossEntropyMulti usebits True N/A model N/A Model layers layers N/A learning_rate_sched N/A Schedule N/A range 10 N/A args epochs 0.97 N/A optimizer N/A RMSProp gradient_clip_value gradient_clip_value stochastic_round N/A args rounding schedule learning_rate_sched N/A callbacks N/A Callbacks model eval_set valid_set N/A args callback_args N/A N/A N/A model fit train_set optimizer optimizer num_epochs N/A args epochs cost cost callbacks callbacks N/A ypred N/A N/A model get_outputs valid_set N/A shape N/A N/A valid_set nbatches N/A args batch_size time_steps N/A prediction N/A N/A N/A N/A N/A N/A ypred argmax 2 reshape shape transpose 1 0 2 N/A fraction_correct N/A N/A N/A prediction N/A valid_set y mean N/A N/A Misclassification error = %.1f%% N/A N/A 1 fraction_correct 100