Package pylearn :: Package io :: Module ubyte
[hide private]

Module ubyte

source code

Provides read_ubyte_matrix

Functions [hide private]
 
read_ubyte_matrix(filename, size0, size1, offset, write=False, align=True, as_dtype='float32')
Read a matrix in 'ubyte' format.
source code

Imports: numpy


Function Details [hide private]

read_ubyte_matrix(filename, size0, size1, offset, write=False, align=True, as_dtype='float32')

source code 

Read a matrix in 'ubyte' format.

This function basically exists in order to read the MNIST files distributed by Yann LeCun. Offset should be 16 for the image files, and 8 for the label files.

Returns a matrix of size0 x size1 elements of type `as_dtype`.