| Total Complexity | 1 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| 1 | from fuel.datasets import H5PYDataset |
||
| 6 | class DogsVsCats(H5PYDataset): |
||
| 7 | """The Kaggle Dogs vs. Cats dataset of cats and dogs images. |
||
| 8 | |||
| 9 | Parameters |
||
| 10 | ---------- |
||
| 11 | which_sets : tuple of str |
||
| 12 | Which split to load. Valid values are 'train' and 'test'. |
||
| 13 | The test set is the one released on Kaggle. |
||
| 14 | |||
| 15 | Notes |
||
| 16 | ----- |
||
| 17 | The Dogs vs. Cats dataset does not provide an official |
||
| 18 | validation split. Users need to create their own |
||
| 19 | training / validation split using the `subset` argument. |
||
| 20 | |||
| 21 | """ |
||
| 22 | filename = 'dogs_vs_cats.hdf5' |
||
| 23 | |||
| 24 | default_transformers = ((ScaleAndShift, [1 / 255.0, 0], |
||
| 25 | {'which_sources': ('image_features',)}),) |
||
| 26 | |||
| 27 | def __init__(self, which_sets, **kwargs): |
||
| 28 | super(DogsVsCats, self).__init__( |
||
| 29 | file_or_path=find_in_data_path(self.filename), |
||
| 30 | which_sets=which_sets, **kwargs) |
||
| 31 |