Module Import alias Import alias identifier ImportFrom alias identifier ImportFrom alias identifier Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Num NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub BinOpAdd BinOpMult NameLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore BinOpMult NameLoad CompareGtE NameLoad Num Assign NameStore BinOpAdd BinOpMult NameLoad CompareLt NameLoad Num BinOpMult CompareGtE NameLoad Num Num Assign NameStore BinOpSub NameLoad Num Assign NameStore BinOpMult NameLoad CompareGtE NameLoad Num Assign NameStore BinOpAdd BinOpMult NameLoad CompareLt NameLoad Num BinOpMult CompareGtE NameLoad Num Num Assign NameStore BinOpSub NameLoad Num Assign NameStore BinOpMult NameLoad CompareGtE NameLoad Num Assign NameStore BinOpAdd BinOpMult NameLoad CompareLt NameLoad Num BinOpMult CompareGtE NameLoad Num Num Assign NameStore SubscriptLoad SubscriptLoad NameLoad Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num ExtSlice Slice Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Assign NameStore SubscriptLoad SubscriptLoad NameLoad Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num ExtSlice Slice Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad TupleLoad Num Num Assign NameStore SubscriptLoad SubscriptLoad NameLoad Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num ExtSlice Slice Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr NameLoad TupleLoad Num Num Return Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub BinOpAdd BinOpMult NameLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore BinOpMult NameLoad CompareGtE NameLoad Num Assign NameStore BinOpAdd BinOpMult NameLoad CompareLt NameLoad Num BinOpMult CompareGtE NameLoad Num Num Assign NameStore SubscriptLoad SubscriptLoad NameLoad Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num ExtSlice Slice Slice SubscriptLoad NameLoad Index Num BinOpAdd SubscriptLoad NameLoad Index Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpMult BinOpDiv Num Call AttributeLoad NameLoad attr BinOpMult BinOpPow BinOpMult Num AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMult Num Call AttributeLoad Call AttributeLoad AttributeLoad BinOpSub NameLoad NameLoad attr attr AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num Num Assign TupleStore ListStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad keyword ListLoad AttributeLoad NameLoad attr keyword Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad keyword Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr NameLoad Return Call AttributeLoad SubscriptLoad NameLoad Index Num attr TupleLoad Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad keyword Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad ListLoad AttributeLoad NameLoad attr Num ListLoad Num AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpMult Num Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad Num Num keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpDiv Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num keyword Str Assign AttributeStore NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad keyword BinOpMult Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If BoolOpAnd NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list
N/A N/A os N/A numpy np numpy linalg LA theano tensor T N/A theano theano.tensor.shared_randomstreams RandomStreams deepy NeuralClassifier deepy.utils build_activation disconnected_grad deepy.utils.functions FLOATX deepy.layers NeuralLayer experiments.attention_models.gaussian_sampler SampleMultivariateGaussian AttentionLayer N/A NeuralLayer N/A __init__ N/A N/A self activation std disable_reinforce random_glimpse N/A relu 0.1 False False N/A N/A N/A self disable_reinforce disable_reinforce N/A N/A self random_glimpse random_glimpse N/A N/A self gaussian_std std N/A N/A N/A N/A super AttentionLayer self __init__ 10 activation N/A initialize N/A N/A self config vars x input_n id N/A UNKNOWN N/A N/A N/A self _config config N/A N/A self _vars vars N/A N/A self input_n input_n N/A N/A self id id N/A N/A self x x N/A N/A N/A self _setup_params N/A N/A N/A self _setup_functions N/A N/A self connected True N/A _glimpse_sensor N/A N/A self x_t l_p N/A N/A N/A 
        Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
        Returns:
            4x12 matrix
         N/A l_p N/A N/A N/A l_p 14 14 2 N/A l_p N/A N/A T cast N/A N/A T round l_p int32 N/A l_p N/A l_p N/A l_p 0 N/A l_p N/A N/A l_p N/A l_p 24 N/A N/A l_p 24 23 N/A l_p2 N/A l_p 2 N/A l_p2 N/A l_p2 N/A l_p2 0 N/A l_p2 N/A N/A l_p2 N/A l_p2 20 N/A N/A l_p2 20 19 N/A l_p3 N/A l_p 6 N/A l_p3 N/A l_p3 N/A l_p3 0 N/A l_p3 N/A N/A l_p3 N/A l_p3 16 N/A N/A l_p3 16 15 N/A glimpse_1 N/A N/A x_t N/A N/A l_p N/A 0 N/A N/A l_p N/A 0 4 N/A N/A N/A N/A l_p N/A 1 N/A N/A l_p N/A 1 4 N/A glimpse_2 N/A N/A x_t N/A N/A l_p2 N/A 0 N/A N/A l_p2 N/A 0 8 N/A N/A N/A N/A l_p2 N/A 1 N/A N/A l_p2 N/A 1 8 N/A glimpse_2 N/A N/A N/A N/A N/A theano tensor signal downsample max_pool_2d glimpse_2 N/A 2 2 N/A glimpse_3 N/A N/A x_t N/A N/A l_p3 N/A 0 N/A N/A l_p3 N/A 0 16 N/A N/A N/A N/A l_p3 N/A 1 N/A N/A l_p3 N/A 1 16 N/A glimpse_3 N/A N/A N/A N/A N/A theano tensor signal downsample max_pool_2d glimpse_3 N/A 4 4 N/A N/A N/A T concatenate N/A glimpse_1 glimpse_2 glimpse_3 N/A _refined_glimpse_sensor N/A N/A self x_t l_p N/A N/A N/A 
        Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
        Returns:
            7*14 matrix
         N/A l_p N/A N/A N/A l_p 14 14 4 N/A l_p N/A N/A T cast N/A N/A T round l_p int32 N/A l_p N/A l_p N/A l_p 0 N/A l_p N/A N/A l_p N/A l_p 21 N/A N/A l_p 21 20 N/A glimpse_1 N/A N/A x_t N/A N/A l_p N/A 0 N/A N/A l_p N/A 0 7 N/A N/A N/A N/A l_p N/A 1 N/A N/A l_p N/A 1 7 N/A glimpse_1 N/A _multi_gaussian_pdf N/A N/A self vec mean N/A N/A N/A norm2d_var N/A N/A 1.0 N/A N/A T sqrt N/A N/A N/A 2 N/A np pi 2 N/A self cov_det_var N/A N/A T exp N/A -0.5 N/A N/A N/A N/A N/A N/A vec mean T dot N/A self cov_inv_var dot N/A vec mean N/A norm2d_var N/A _glimpse_network N/A N/A self x_t l_p N/A N/A N/A 
        Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
        Returns:
            4x12 matrix
         N/A sensor_output N/A N/A self _refined_glimpse_sensor x_t l_p N/A sensor_output N/A N/A T flatten sensor_output N/A h_g N/A N/A self _relu N/A N/A T dot sensor_output N/A self W_g0 N/A h_l N/A N/A self _relu N/A N/A T dot l_p N/A self W_g1 N/A g N/A N/A self _relu N/A N/A N/A T dot h_g N/A self W_g2_hg N/A N/A T dot h_l N/A self W_g2_hl N/A g N/A _location_network N/A N/A self h_t N/A N/A N/A 
        Parameters:
            h_t - 256x1 vector
        Returns:
            2x1 focus vector
         N/A N/A N/A T dot h_t N/A self W_l N/A _action_network N/A N/A self h_t N/A N/A N/A 
        Parameters:
            h_t - 256x1 vector
        Returns:
            10x1 vector
         N/A z N/A N/A self _relu N/A N/A N/A T dot h_t N/A self W_a N/A self B_a N/A N/A N/A self _softmax z N/A _core_network N/A N/A self l_p h_p x_t N/A N/A N/A 
        Parameters:
            x_t - 28x28 image
            l_p - 2x1 focus vector
            h_p - 256x1 vector
        Returns:
            h_t, 256x1 vector
         N/A g_t N/A N/A self _glimpse_network x_t l_p N/A h_t N/A N/A self _tanh N/A N/A N/A N/A T dot g_t N/A self W_h_g N/A N/A T dot h_p N/A self W_h N/A self B_h N/A l_t N/A N/A self _location_network h_t N/A N/A N/A self disable_reinforce N/A N/A sampled_l_t N/A N/A self _sample_gaussian l_t N/A self cov N/A sampled_pdf N/A N/A self _multi_gaussian_pdf N/A disconnected_grad sampled_l_t l_t N/A wl_grad N/A N/A T grad N/A N/A T log sampled_pdf N/A self W_l N/A N/A sampled_l_t l_t N/A wl_grad N/A self W_l N/A N/A N/A self random_glimpse N/A self disable_reinforce N/A N/A sampled_l_t N/A N/A N/A N/A self srng uniform N/A 2 0.8 N/A a_t N/A N/A self _action_network h_t N/A N/A sampled_l_t h_t a_t wl_grad N/A _output_func N/A N/A self N/A N/A N/A N/A self x N/A N/A N/A self x reshape N/A 28 28 N/A N/A N/A l_ts h_ts a_ts wl_grads _ N/A N/A theano scan fn N/A self _core_network outputs_info N/A N/A self l0 N/A self h0 None None non_sequences N/A N/A self x n_steps 5 N/A N/A self positions l_ts N/A N/A self last_decision N/A N/A T argmax N/A a_ts N/A -1 N/A wl_grad N/A N/A N/A T sum wl_grads axis 0 N/A N/A wl_grads shape N/A 0 N/A N/A self wl_grad wl_grad N/A N/A N/A N/A a_ts N/A -1 reshape N/A 1 10 N/A _setup_functions N/A N/A self N/A N/A N/A N/A self _assistive_params N/A N/A N/A self _relu N/A build_activation tanh N/A N/A self _tanh N/A build_activation tanh N/A N/A self _softmax N/A build_activation softmax N/A N/A self output_func N/A N/A self _output_func N/A _setup_params N/A N/A self N/A N/A N/A N/A self srng N/A RandomStreams seed 234 N/A N/A self large_cov N/A N/A np array N/A N/A 0.06 0 N/A 0 0.06 dtype FLOATX N/A N/A self small_cov N/A N/A np array N/A N/A N/A self gaussian_std 0 N/A 0 N/A self gaussian_std dtype FLOATX N/A N/A self cov N/A N/A theano shared N/A N/A np array N/A self small_cov dtype FLOATX N/A N/A self cov_inv_var N/A N/A theano shared N/A N/A np array N/A N/A LA inv N/A self small_cov dtype FLOATX N/A N/A self cov_det_var N/A N/A theano shared N/A N/A np array N/A N/A LA det N/A self small_cov dtype FLOATX N/A N/A self _sample_gaussian N/A SampleMultivariateGaussian N/A N/A self W_g0 N/A N/A self create_weight N/A 7 7 128 suffix g0 N/A N/A self W_g1 N/A N/A self create_weight 2 128 suffix g1 N/A N/A self W_g2_hg N/A N/A self create_weight 128 256 suffix g2_hg N/A N/A self W_g2_hl N/A N/A self create_weight 128 256 suffix g2_hl N/A N/A self W_h_g N/A N/A self create_weight 256 256 suffix h_g N/A N/A self W_h N/A N/A self create_weight 256 256 suffix h N/A N/A self B_h N/A N/A self create_bias 256 suffix h N/A N/A self h0 N/A N/A self create_vector 256 h0 N/A N/A self l0 N/A N/A self create_vector 2 l0 N/A N/A N/A N/A self l0 set_value N/A N/A np array N/A -1 -1 dtype FLOATX N/A N/A self W_l N/A N/A self create_weight 256 2 suffix l N/A N/A N/A N/A self W_l set_value N/A N/A N/A N/A self W_l get_value 10 N/A N/A self B_l N/A N/A self create_bias 2 suffix l N/A N/A self W_a N/A N/A self create_weight 256 10 suffix a N/A N/A self B_a N/A N/A self create_bias 10 suffix a N/A N/A self W N/A N/A self W_g0 N/A self W_g1 N/A self W_g2_hg N/A self W_g2_hl N/A self W_h_g N/A self W_h N/A self W_a N/A N/A self B N/A N/A self B_h N/A self B_a N/A N/A self parameters N/A N/A self W_l N/A N/A get_network N/A N/A model std disable_reinforce random_glimpse N/A None 0.005 False False N/A N/A 
    Get baseline model.
    Parameters:
        model - model path
    Returns:
        network
     N/A network N/A NeuralClassifier input_dim N/A 28 28 N/A N/A N/A network stack_layer N/A AttentionLayer std std disable_reinforce disable_reinforce random_glimpse random_glimpse N/A N/A model N/A N/A N/A os path exists model N/A N/A N/A N/A network load_params model N/A network N/A