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]¶
-
class
twodlearn.datasets.cifar10.
DataSet
(images, labels, one_hot=False, np_type=<class 'numpy.float32'>, reshape=True)[source]¶ Bases:
object
-
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.