Module Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Import alias Import alias Import alias Import alias alias alias ImportFrom alias ImportFrom alias Assign NameStore Num Assign NameStore Num FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler body Print TupleLoad Str NameLoad Global identifier Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Global identifier If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad decorator_list Expr Call NameLoad NameLoad BinOpAdd NameLoad Str NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Str Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str With Call NameLoad NameLoad Str NameStore body Assign TupleStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Num If CompareNotEq NameLoad NameLoad body Raise Call NameLoad BinOpAdd Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword Str attr TupleLoad NameLoad NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs AttributeLoad NameLoad attr Str body Assign NameStore CompareGtE NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIn AttributeLoad NameLoad attr TupleLoad Str Str body AugAssignDiv NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad NameLoad Str NameStore body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Num If CompareNotEq NameLoad NameLoad body Raise Call NameLoad BinOpAdd Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Str Return NameLoad decorator_list
N/A N/A Low-level utilities for reading in raw MNIST files. N/A __author__ David Warde-Farley N/A __copyright__ Copyright 2012, Universite de Montreal N/A __credits__ N/A David Warde-Farley N/A __license__ 3-clause BSD N/A __email__ wardefar@iro N/A __maintainer__ David Warde-Farley N/A struct N/A numpy N/A gzip N/A tarfile inspect os six.moves.urllib.request urlretrieve mozi.utils.progbar Progbar N/A MNIST_IMAGE_MAGIC 2051 N/A MNIST_LABEL_MAGIC 2049 get_mnist_file N/A N/A fpath origin N/A N/A N/A datadir N/A N/A N/A os path dirname fpath N/A N/A N/A N/A N/A os path exists datadir N/A N/A N/A N/A os makedirs datadir N/A N/A N/A f N/A open fpath N/A N/A N/A N/A N/A Downloading data from origin N/A progbar N/A progbar None dl_progress N/A N/A count block_size total_size N/A N/A N/A progbar N/A N/A progbar None N/A N/A progbar N/A Progbar total_size N/A N/A N/A N/A progbar update N/A count block_size N/A N/A N/A urlretrieve origin N/A fpath .gz dl_progress N/A progbar None N/A fin N/A N/A gzip open N/A fpath .gz rb N/A fout N/A open fpath wb N/A N/A N/A fout write N/A N/A fin read N/A N/A N/A fin close N/A N/A N/A fout close N/A fpath N/A open_if_filename N/A object N/A __init__ N/A N/A self f mode buffering N/A r -1 N/A N/A N/A self _f f N/A N/A self _mode mode N/A N/A self _buffering buffering N/A N/A self _handle None N/A __enter__ N/A N/A self N/A N/A N/A N/A isinstance N/A self _f basestring N/A N/A N/A self _handle N/A open N/A self _f N/A self _mode N/A self _buffering N/A N/A N/A self _handle N/A self _f N/A N/A self _handle N/A __exit__ N/A N/A self exc_type exc_value traceback N/A N/A N/A N/A N/A self _handle N/A self _f N/A N/A N/A N/A N/A self _handle close N/A N/A read_mnist_images N/A N/A fn dtype N/A None N/A N/A 
    Read MNIST images from the original ubyte file format.

    Parameters
    ----------
    fn : str or object
        Filename/path from which to read labels, or an open file
        object for the same (will not be closed for you).

    dtype : str or object, optional
        A NumPy dtype or string that can be converted to one.
        If unspecified, images will be returned in their original
        unsigned byte format.

    Returns
    -------
    images : ndarray, shape (n_images, n_rows, n_cols)
        An image array, with individual examples indexed along the
        first axis and the image dimensions along the second and
        third axis.

    Notes
    -----
    If the dtype provided was boolean, the resulting array will
    be boolean with `True` if the corresponding pixel had a value
    greater than or equal to 128, `False otherwise.

    If the dtype provided was a float or complex dtype, the values
    will be mapped to the unit interval [0, 1], with pixel values
    that were 255 in the original unsigned byte representation
    equal to 1.0.
     N/A N/A open_if_filename fn rb f N/A N/A N/A magic number rows cols N/A N/A struct unpack >iiii N/A N/A f read 16 N/A N/A magic MNIST_IMAGE_MAGIC N/A N/A N/A ValueError N/A wrong magic number reading MNIST image file:  fn N/A array N/A N/A N/A N/A numpy fromfile f dtype uint8 reshape N/A number rows cols N/A dtype N/A N/A dtype N/A N/A numpy dtype dtype N/A N/A N/A dtype kind b N/A N/A array N/A array 128 N/A N/A array N/A N/A array astype dtype N/A N/A N/A dtype kind N/A f c N/A N/A array 255.0 N/A array N/A read_mnist_labels N/A N/A fn N/A N/A N/A 
    Read MNIST labels from the original ubyte file format.

    Parameters
    ----------
    fn : str or object
        Filename/path from which to read labels, or an open file
        object for the same (will not be closed for you).

    Returns
    -------
    labels : ndarray, shape (nlabels,)
        A one-dimensional unsigned byte array containing the
        labels as integers.
     N/A N/A open_if_filename fn rb f N/A N/A N/A magic number N/A N/A struct unpack >ii N/A N/A f read 8 N/A N/A magic MNIST_LABEL_MAGIC N/A N/A N/A ValueError N/A wrong magic number reading MNIST label file:  fn N/A array N/A N/A numpy fromfile f dtype uint8 N/A array N/A