Learn practical skills, build real-world projects, and advance your career
!pip install jovian --upgrade -q
import jovian
jovian.set_project('03-logistic-regression')
jovian.set_colab_id('1lqx4KsL8g2SGu3_YCedNf11oD_r9e5V5')
import torch
import torchvision
from torchvision.datasets import MNIST
dataset = MNIST(root = 'data/' , download=True)
100.0%
Extracting data/MNIST\raw\train-images-idx3-ubyte.gz to data/MNIST\raw Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to data/MNIST\raw\train-labels-idx1-ubyte.gz
102.8%
Extracting data/MNIST\raw\train-labels-idx1-ubyte.gz to data/MNIST\raw Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to data/MNIST\raw\t10k-images-idx3-ubyte.gz
100.0%
Extracting data/MNIST\raw\t10k-images-idx3-ubyte.gz to data/MNIST\raw Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to data/MNIST\raw\t10k-labels-idx1-ubyte.gz
112.7%
Extracting data/MNIST\raw\t10k-labels-idx1-ubyte.gz to data/MNIST\raw
C:\Users\yashr\AppData\Local\Programs\Python\Python39\lib\site-packages\torchvision\datasets\mnist.py:498: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:180.) return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
len(dataset)
60000
test_dataset = MNIST(root = 'data/' , train = False)