| Total Complexity | 1 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| 1 | # -*- coding: utf-8 -*- |
||
| 7 | class MNIST(H5PYDataset): |
||
| 8 | u"""MNIST dataset. |
||
| 9 | |||
| 10 | MNIST (Mixed National Institute of Standards and Technology) [LBBH] is |
||
| 11 | a database of handwritten digits. It is one of the most famous |
||
| 12 | datasets in machine learning and consists of 60,000 training images |
||
| 13 | and 10,000 testing images. The images are grayscale and 28 x 28 pixels |
||
| 14 | large. It is accessible through Yann LeCun's website [LECUN]. |
||
| 15 | |||
| 16 | .. [LECUN] http://yann.lecun.com/exdb/mnist/ |
||
| 17 | |||
| 18 | Parameters |
||
| 19 | ---------- |
||
| 20 | which_sets : tuple of str |
||
| 21 | Which split to load. Valid values are 'train' and 'test', |
||
| 22 | corresponding to the training set (60,000 examples) and the test |
||
| 23 | set (10,000 examples). |
||
| 24 | |||
| 25 | """ |
||
| 26 | filename = 'mnist.hdf5' |
||
| 27 | default_transformers = uint8_pixels_to_floatX(('features',)) |
||
| 28 | |||
| 29 | def __init__(self, which_sets, **kwargs): |
||
| 30 | kwargs.setdefault('load_in_memory', True) |
||
| 31 | super(MNIST, self).__init__( |
||
| 32 | file_or_path=find_in_data_path(self.filename), |
||
| 33 | which_sets=which_sets, **kwargs) |
||
| 34 |