twodlearn.datasets.cifar10 module

class twodlearn.datasets.cifar10.Cifar10(work_directory='tmp/', one_hot=True, dtype=<class 'numpy.float32'>, reshape=False, valid_size=0.1)[source]

Bases: twodlearn.datasets.base.Datasets

filename = 'cifar-10-python.tar.gz'[source]
src = 'https://www.cs.toronto.edu/~kriz/'[source]
class twodlearn.datasets.cifar10.DataSet(images, labels, one_hot=False, np_type=<class 'numpy.float32'>, reshape=True)[source]

Bases: object

property epochs_completed[source]
property images[source]
property labels[source]
next_batch(batch_size)[source]

Return the next batch_size examples from this data set.

property num_examples[source]
twodlearn.datasets.cifar10.dense_to_one_hot(labels_dense, num_classes)[source]

Convert class labels from scalars to one-hot vectors.

twodlearn.datasets.cifar10.maybe_download(filename, work_directory, source_url)[source]

Download the data from source url, unless it’s already here. :param filename: string, name of the file in the directory. :param work_directory: string, path to working directory. :param source_url: url to download from if file doesn’t exist.

Returns

Path to resulting file.

twodlearn.datasets.cifar10.read_data_sets(train_dir, one_hot=False, np_type=<class 'numpy.float32'>, reshape=True, validation_p=0.1)[source]