vegans.utils.loading package¶
Subpackages¶
Submodules¶
vegans.utils.loading.CIFAR100Loader module¶
vegans.utils.loading.CIFAR10Loader module¶
-
class
vegans.utils.loading.CIFAR10Loader.
CIFAR10Loader
(root=None)[source]¶ Bases:
vegans.utils.loading.MNISTLoader.MNISTLoader
-
static
_preprocess
(X_train, y_train, X_test, y_test)[source]¶ Preprocess mnist by normalizing and padding.
-
static
vegans.utils.loading.CelebALoader module¶
-
class
vegans.utils.loading.CelebALoader.
CelebALoader
(root=None, batch_size=32, max_loaded_images=5000, crop_size=128, output_shape=64, verbose=False, **kwargs)[source]¶ Bases:
vegans.utils.loading.DatasetLoader.DatasetLoader
-
__init__
(root=None, batch_size=32, max_loaded_images=5000, crop_size=128, output_shape=64, verbose=False, **kwargs)[source]¶ - Parameters
batch_size (int) – batch size during training.
max_loaded_images (int) – Number of examples loaded into memory, before new batch is loaded.
kwargs – Other input arguments to torchvision.utils.data.DataLoader
-
load_adversary
(x_dim=None, y_dim=40, adv_type='Discriminator')[source]¶ Loads a working adversary architecture
-
vegans.utils.loading.DatasetLoader module¶
-
class
vegans.utils.loading.DatasetLoader.
DatasetLoader
(metadata, root=None)[source]¶ Bases:
abc.ABC
Class that downloads a dataset and caches it locally. Assumes that the file can be downloaded (i.e. publicly available via an URI)
- So far available are:
MNIST: Handwritten digits with labels. Can be downloaded via download=True.
FashionMNIST: Clothes with labels. Can be downloaded via download=True.
- CelebA: Pictures of celebrities with attributes. Must be downloaded from https://www.kaggle.com/jessicali9530/celeba-dataset
and moved into root folder.
- CIFAR: Pictures of objects with labels. Must be downloaded from http://www.cs.toronto.edu/~kriz/cifar.html
and moved into root folder.
-
_check_dataset_integrity_or_raise
(path, expected_hash)[source]¶ Ensures that the dataset exists and its MD5 checksum matches the expected hash.
-
abstract
_load_from_disk
()[source]¶ Given a Path to the file and a DataLoaderMetadata object, returns train and test sets as numpy arrays. One can assume that the file exists and its MD5 checksum has been verified before this function is called
vegans.utils.loading.ExampleLoader module¶
-
class
vegans.utils.loading.ExampleLoader.
ExampleLoader
[source]¶
vegans.utils.loading.FashionMNISTLoader module¶
vegans.utils.loading.MNISTLoader module¶
-
class
vegans.utils.loading.MNISTLoader.
MNISTLoader
(root=None)[source]¶ Bases:
vegans.utils.loading.DatasetLoader.DatasetLoader
-
static
_preprocess
(X_train, y_train, X_test, y_test)[source]¶ Preprocess mnist by normalizing and padding.
-
static