Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Assign NameStore NameLoad FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Index Num Str body Print BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad NameLoad orelse If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assert Call NameLoad NameLoad TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num attr If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Slice Num Num keyword SubscriptLoad AttributeLoad NameLoad attr Index Num keyword TupleLoad Str Num Num Str Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword TupleLoad Str Str Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Slice Num Slice Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assert Call NameLoad NameLoad TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num attr If Call NameLoad NameLoad NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index Num orelse If Call NameLoad NameLoad NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad NameLoad NameLoad body Print BinOpMod Str Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num FunctionDef arguments args NameParam NameParam defaults Num body Assign NameStore Num Assign NameStore Num Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore BinOpFloorDiv NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad Call AttributeLoad NameLoad attr attr comprehension NameStore NameLoad Assign NameStore BinOpFloorDiv NameLoad NameLoad If CompareLt BinOpMult NameLoad NameLoad NameLoad body AugAssignAdd NameStore Num Assert CompareGtE BinOpMult NameLoad NameLoad NameLoad Assign NameStore Num Assign NameStore BinOpMult NameLoad BinOpDiv BinOpMult NameLoad Num NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword TupleLoad NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr TupleLoad Num Num Num For NameStore NameLoad body For NameStore NameLoad body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad Return TupleLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr keyword Num keyword Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword NameLoad FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Index NameLoad Ellipsis Assign NameStore SubscriptLoad Call NameLoad NameLoad ExtSlice Index NameLoad Ellipsis Assign NameStore SubscriptLoad NameLoad Slice SubscriptLoad AttributeLoad NameLoad attr Index Num For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword Str Assert CompareEq Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice Call NameLoad NameLoad Assert CompareEq Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Assert CompareEq Call NameLoad NameLoad BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assert CompareGtE NameLoad Num Assert CompareIn NameLoad TupleLoad Num Num Num Assign SubscriptStore NameLoad Ellipsis BinOpMod BinOpAdd BinOpAdd NameLoad NameLoad NameLoad NameLoad decorator_list If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str body Expr Call NameLoad NameLoad Call NameLoad NameLoad IfExp CompareEq AttributeLoad NameLoad attr Str Num Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad orelse If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str body Assign NameStore SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad Num Expr Call NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad IfExp CompareEq AttributeLoad NameLoad attr Str Num Num Expr Call NameLoad orelse If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Num decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Expr Call NameLoad Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 
Interactive viewer for the convolutional weights in a pickled model.

Unlike ./show_weights, this shows one unit's weights at a time. This
allows it to display weights from higher levels (which can have 100s
of input channels), not just the first.
 N/A os N/A sys N/A warnings N/A argparse N/A numpy pylearn2.models.mlp MLP ConvElemwise CompositeLayer pylearn2.models.maxout MaxoutConvC01B pylearn2.utils safe_zip serial pylearn2.space Conv2DSpace N/A N/A matplotlib pyplot N/A N/A N/A ImportError N/A import_error N/A N/A N/A N/A warnings warn Can't use this script without matplotlib. N/A pyplot None _parse_args N/A N/A N/A N/A N/A parser N/A N/A argparse ArgumentParser description Interactive browser of convolutional weights. Up/down keys switch layers. Left/right keys switch units. N/A N/A N/A parser add_argument -i --input required True help .pkl file of model N/A result N/A N/A parser parse_args N/A N/A N/A N/A N/A N/A os path splitext N/A result input N/A 1 .pkl N/A N/A N/A Expected --input to end in .pkl, got %s. N/A result input N/A N/A N/A sys exit 1 N/A result N/A _get_conv_layers N/A N/A layer result N/A None N/A N/A 
    Returns a list of the convolutional layers in a model.

    Returns
    -------
    rval: list
      Lists the convolutional layers (ConvElemwise, MaxoutConvC01B).
     N/A N/A result None N/A N/A result N/A N/A N/A isinstance layer N/A MLP CompositeLayer N/A N/A sub_layer N/A layer layers N/A N/A N/A _get_conv_layers sub_layer result N/A N/A N/A isinstance layer N/A MaxoutConvC01B ConvElemwise N/A N/A N/A N/A result append layer N/A result N/A _get_conv_weights_bc01 N/A N/A layer N/A N/A N/A 
    Returns a conv. layer's weights in BC01 format.

    Parameters
    ----------
    layer: MaxoutConvC01B or ConvElemwise

    Returns
    -------
    rval: numpy.ndarray
      The kernel weights in BC01 axis order. (B: output channels, C: input
      channels)
     N/A N/A isinstance layer N/A MaxoutConvC01B ConvElemwise N/A weights N/A N/A N/A N/A N/A layer get_params N/A 0 get_value N/A N/A isinstance layer MaxoutConvC01B N/A N/A c01b N/A Conv2DSpace shape N/A N/A weights shape N/A 1 3 num_channels N/A N/A weights shape N/A 0 axes N/A c 0 1 b N/A bc01 N/A Conv2DSpace shape N/A c01b shape num_channels N/A c01b num_channels axes N/A b c 0 1 N/A weights N/A N/A c01b np_format_as weights bc01 N/A N/A N/A isinstance layer ConvElemwise N/A N/A weights N/A weights N/A N/A N/A N/A -1 N/A -1 N/A weights N/A _num_conv_units N/A N/A conv_layer N/A N/A N/A 
    Returns a conv layer's number of output channels.
     N/A N/A isinstance conv_layer N/A MaxoutConvC01B ConvElemwise N/A weights N/A N/A N/A N/A N/A conv_layer get_params N/A 0 get_value N/A N/A isinstance conv_layer MaxoutConvC01B N/A N/A N/A N/A weights shape N/A -1 N/A N/A N/A isinstance conv_layer ConvElemwise N/A N/A N/A N/A weights shape N/A 0 N/A main N/A N/A N/A N/A N/A Entry point of script. N/A args N/A _parse_args N/A model N/A N/A serial load N/A args input N/A N/A N/A isinstance model MLP N/A N/A N/A Expected the .pkl file to contain an MLP, got a %s. N/A str N/A model type N/A N/A N/A sys exit 1 get_figure_and_axes N/A N/A conv_layers window_width N/A 800 N/A N/A kernel_display_width 20 N/A margin 5 N/A grid_square_width N/A kernel_display_width margin N/A num_columns N/A window_width grid_square_width N/A max_num_channels N/A N/A numpy max N/A N/A N/A N/A layer get_input_space num_channels N/A layer conv_layers N/A num_rows N/A max_num_channels num_columns N/A N/A N/A num_rows num_columns max_num_channels N/A N/A num_rows 1 N/A N/A N/A num_rows num_columns max_num_channels N/A window_width 15 N/A window_height N/A window_width N/A N/A num_rows 1.8 num_columns N/A N/A figure all_axes N/A N/A pyplot subplots num_rows num_columns squeeze False figsize N/A window_width window_height N/A N/A unit_index axes N/A enumerate N/A all_axes flat N/A N/A subplot_title N/A N/A axes set_title N/A %d unit_index N/A N/A N/A subplot_title set_size 8 N/A N/A N/A subplot_title set_color N/A 0.3 0.3 0.3 N/A axes_row all_axes N/A N/A axes axes_row N/A N/A N/A N/A N/A N/A axes get_xaxis set_visible False N/A N/A N/A N/A N/A axes get_yaxis set_visible False N/A N/A figure all_axes N/A N/A conv_layers N/A _get_conv_layers model N/A N/A figure all_axes N/A get_figure_and_axes conv_layers N/A title_text N/A N/A figure suptitle title N/A N/A N/A pyplot tight_layout h_pad 0.1 w_pad 0.5 N/A layer_index N/A N/A numpy array 0 N/A unit_indices N/A N/A numpy zeros N/A len N/A model layers dtype int redraw N/A N/A N/A N/A N/A 
        Draws the currently selected convolutional kernel.
         N/A axes_list N/A N/A all_axes flatten N/A layer N/A conv_layers N/A layer_index N/A unit_index N/A unit_indices N/A N/A layer_index N/A N/A weights N/A N/A _get_conv_weights_bc01 layer N/A N/A unit_index N/A N/A active_axes N/A axes_list N/A N/A N/A weights shape N/A 0 N/A N/A axes weights N/A safe_zip active_axes weights N/A N/A N/A N/A axes set_visible True N/A N/A N/A axes imshow weights cmap gray interpolation nearest N/A N/A N/A len N/A frozenset active_axes N/A len active_axes N/A unused_axes N/A axes_list N/A N/A len active_axes N/A N/A N/A len N/A frozenset unused_axes N/A len unused_axes N/A N/A N/A len axes_list N/A N/A len active_axes N/A len unused_axes N/A axes unused_axes N/A N/A N/A N/A axes set_visible False N/A N/A N/A title_text set_text N/A Layer %s, unit %d N/A N/A layer layer_name N/A unit_indices N/A layer_index N/A N/A N/A N/A figure canvas draw N/A on_key_press N/A N/A event N/A N/A N/A Callback for key press events increment N/A N/A index size step N/A N/A N/A 
            Increments an index in-place.

            Parameters
            ----------
            index: numpy.ndarray
              scalar (0-dim array) of dtype=int. Non-negative.

            size: int
              One more than the maximum permissible index.

            step: int
              -1, 0, or 1.
             N/A N/A index 0 N/A N/A step N/A 0 -1 1 N/A N/A index N/A N/A N/A N/A index size step size N/A N/A N/A N/A event key N/A up down N/A N/A N/A increment layer_index N/A len conv_layers N/A N/A N/A event key up 1 -1 N/A unit_index N/A unit_indices N/A layer_index N/A N/A redraw N/A N/A N/A N/A event key N/A right left N/A N/A unit_index N/A unit_indices N/A layer_index N/A layer_index 1 N/A N/A increment unit_index N/A _num_conv_units N/A conv_layers N/A layer_index N/A N/A N/A event key right 1 -1 N/A N/A redraw N/A N/A N/A N/A event key q N/A N/A N/A N/A sys exit 0 N/A N/A N/A N/A N/A figure canvas mpl_connect key_press_event on_key_press N/A N/A redraw N/A N/A N/A pyplot show N/A N/A N/A __name__ __main__ N/A N/A N/A main