commit 146521a811be43ae5d1c8469cd2669524266a7bc Author: Eduardo Cueto-Mendoza Date: Thu Aug 22 16:10:28 2024 +0100 initial commit diff --git a/making_noise.py b/making_noise.py new file mode 100644 index 0000000..f588680 --- /dev/null +++ b/making_noise.py @@ -0,0 +1,40 @@ +import torch +import matplotlib.pyplot as plt +from torchvision import datasets +from torch.utils.data import Dataset +from torch.utils.data import DataLoader +import torchvision.transforms as transforms + + +def get_mnist_loaders(batch_size=128, test_batch_size=1000, perc=1.0): + transform_train = transforms.Compose([ + transforms.RandomCrop(28, padding=4), + transforms.ToTensor(), + transforms.Normalize((0.5,), (0.5,)), + ]) + + transform_test = transforms.Compose([ + transforms.ToTensor(), + transforms.Normalize((0.5,), (0.5,)), + ]) + + train_loader = DataLoader( + datasets.MNIST(root='.data/mnist', train=True, download=True, transform=transform_train), batch_size=batch_size, + shuffle=True, num_workers=2, drop_last=True + ) + + train_eval_loader = DataLoader( + datasets.MNIST(root='.data/mnist', train=True, download=True, transform=transform_test), + batch_size=test_batch_size, shuffle=True, num_workers=2, drop_last=True + ) + + test_loader = DataLoader( + datasets.MNIST(root='.data/mnist', train=False, download=True, transform=transform_test), + batch_size=test_batch_size, shuffle=False, num_workers=2, drop_last=True + ) + + return train_loader, test_loader, train_eval_loader + + +if __name__ == '__main__': + test = get_mnist_loaders() diff --git a/t10k-images-idx3-ubyte.gz b/t10k-images-idx3-ubyte.gz new file mode 100644 index 0000000..84332eb Binary files /dev/null and b/t10k-images-idx3-ubyte.gz differ diff --git a/t10k-labels-idx1-ubyte.gz b/t10k-labels-idx1-ubyte.gz new file mode 100644 index 0000000..0538792 Binary files /dev/null and b/t10k-labels-idx1-ubyte.gz differ diff --git a/train-images-idx3-ubyte.gz b/train-images-idx3-ubyte.gz new file mode 100644 index 0000000..692cb8c Binary files /dev/null and b/train-images-idx3-ubyte.gz differ diff --git a/train-labels-idx1-ubyte.gz b/train-labels-idx1-ubyte.gz new file mode 100644 index 0000000..7abdabb Binary files /dev/null and b/train-labels-idx1-ubyte.gz differ