Module Expr Str ImportFrom alias Import alias Import alias Import alias ImportFrom alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Expr Call AttributeLoad NameLoad attr Num Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad keyword Str keyword NameLoad keyword Call NameLoad Assign NameStore Call NameLoad Call NameLoad keyword NameLoad keyword ListLoad Str keyword Call NameLoad keyword Str keyword Call NameLoad NameLoad NameLoad keyword Str keyword Str NameLoad keyword Call NameLoad Num keyword Call NameLoad Num keyword Str Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call AttributeLoad NameLoad attr ListComp TupleLoad NameLoad AttributeLoad Call AttributeLoad NameLoad attr attr comprehension TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad attr attr keyword Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr BinOpMult UnaryOpUSub AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr Str Assign NameStore Call NameLoad keyword NameLoad keyword Call NameLoad Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad attr attr keyword Call NameLoad Num Assign NameStore Call NameLoad keyword NameLoad keyword Call NameLoad Call NameLoad NameLoad NameLoad keyword Call NameLoad NameLoad keyword Call NameLoad NameLoad keyword ListLoad Call NameLoad keyword NameLoad Call NameLoad ListLoad NameLoad keyword Str keyword NameLoad Call NameLoad ListLoad NameLoad keyword Str keyword Num Call NameLoad NameLoad keyword Num Call NameLoad keyword Num Expr Call AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad Call NameLoad NameLoad Str Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore Call AttributeLoad Call NameLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword Num keyword NameLoad attr Assign TupleStore NameStore NameStore NameStore ListComp SubscriptLoad NameLoad ExtSlice Slice Index Num comprehension NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr keyword Num keyword NameLoad Expr Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr NameLoad AugAssignDiv NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Slice Num body AugAssignAdd SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Num AugAssignDiv NameStore SubscriptLoad Call AttributeLoad NameLoad attr keyword Num ExtSlice Slice Index NameLoad Expr Call NameLoad Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr orelse Assert NameLoad decorator_list
N/A N/A Learn a Markov chain with an RNN and sample from it. __future__ print_function N/A logging N/A pprint N/A sys six.moves cPickle N/A numpy N/A theano theano tensor blocks.bricks Tanh blocks.bricks.recurrent GatedRecurrent blocks.bricks.sequence_generators SequenceGenerator Readout SoftmaxEmitter LookupFeedback blocks.graph ComputationGraph fuel.streams DataStream fuel.schemes ConstantScheme blocks.algorithms GradientDescent Scale blocks.initialization Orthogonal IsotropicGaussian Constant blocks.model Model blocks.monitoring aggregation blocks.extensions FinishAfter Printing blocks.extensions.saveload Checkpoint blocks.extensions.monitoring TrainingDataMonitoring blocks.serialization load blocks.main_loop MainLoop blocks.select Selector dataset MarkovChainDataset N/A N/A N/A sys setrecursionlimit 10000 N/A floatX N/A N/A theano config floatX N/A logger N/A N/A logging getLogger __name__ main N/A N/A mode save_path steps num_batches N/A N/A N/A num_states N/A MarkovChainDataset num_states N/A N/A mode train N/A N/A rng N/A N/A N/A numpy random RandomState 1 N/A batch_size 50 N/A seq_len 100 N/A dim 10 N/A feedback_dim 8 N/A transition N/A GatedRecurrent name transition dim dim activation N/A Tanh N/A generator N/A SequenceGenerator N/A Readout readout_dim num_states source_names N/A states emitter N/A SoftmaxEmitter name emitter feedback_brick N/A LookupFeedback num_states feedback_dim name feedback name readout transition weights_init N/A IsotropicGaussian 0.01 biases_init N/A Constant 0 name generator N/A N/A N/A generator push_initialization_config N/A N/A transition weights_init N/A Orthogonal N/A N/A N/A generator initialize N/A N/A N/A logger info N/A Parameters:
 N/A N/A pprint pformat N/A N/A key N/A N/A N/A value get_value shape N/A N/A key value N/A N/A N/A N/A N/A Selector generator get_parameters items width 120 N/A N/A N/A logger info N/A N/A Markov chain entropy: {} format N/A MarkovChainDataset entropy N/A N/A N/A logger info N/A N/A Expected min error: {} format N/A N/A N/A MarkovChainDataset entropy seq_len N/A x N/A N/A tensor lmatrix data N/A cost N/A N/A aggregation mean N/A N/A N/A N/A generator cost_matrix N/A x N/A N/A N/A sum N/A N/A x shape N/A 1 N/A N/A cost name sequence_log_likelihood N/A algorithm N/A GradientDescent cost cost parameters N/A list N/A N/A N/A N/A N/A Selector generator get_parameters values step_rule N/A Scale 0.001 N/A main_loop N/A MainLoop algorithm algorithm data_stream N/A DataStream N/A MarkovChainDataset rng seq_len iteration_scheme N/A ConstantScheme batch_size model N/A Model cost extensions N/A N/A FinishAfter after_n_batches num_batches N/A TrainingDataMonitoring N/A cost prefix this_step after_batch True N/A TrainingDataMonitoring N/A cost prefix average every_n_batches 100 N/A Checkpoint save_path every_n_batches 500 N/A Printing every_n_batches 100 N/A N/A N/A main_loop run N/A N/A N/A mode sample N/A N/A main_loop N/A load N/A open save_path rb N/A generator N/A N/A N/A N/A main_loop model get_top_bricks N/A -1 N/A sample N/A N/A N/A ComputationGraph N/A N/A generator generate n_steps steps batch_size 1 iterate True get_theano_function N/A N/A states outputs costs N/A N/A data N/A N/A N/A 0 N/A data N/A sample N/A N/A N/A numpy set_printoptions precision 3 suppress True N/A N/A print N/A N/A Generation cost:
{} format N/A N/A costs sum N/A freqs N/A N/A N/A N/A numpy bincount outputs astype floatX N/A freqs N/A N/A freqs sum N/A N/A print N/A N/A Frequencies:
 {} vs {} format freqs N/A MarkovChainDataset equilibrium N/A trans_freqs N/A N/A numpy zeros N/A num_states num_states dtype floatX N/A N/A a b N/A zip outputs N/A outputs N/A 1 N/A N/A N/A trans_freqs N/A N/A a b 1 N/A trans_freqs N/A N/A N/A trans_freqs sum axis 1 N/A N/A N/A None N/A N/A print N/A N/A Transition frequencies:
{}
vs
{} format trans_freqs N/A MarkovChainDataset trans_prob N/A N/A False N/A