Completed
Push — master ( 3e1d4c...f31f72 )
by Bart
27s
created

DogsVsCats.__init__()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 4
rs 10
1
from fuel.datasets import H5PYDataset
2
from fuel.transformers import ScaleAndShift
3
from fuel.utils import find_in_data_path
4
5
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