Updated 4 years ago
#Image Classification with Logistic Regression (Minimal)
# Imports
import torch
import jovian
import torchvision
import torch.nn as nn
import matplotlib.pyplot as plt
import torch.nn.functional as F
import torchvision.transforms as transforms
from torchvision.datasets import MNIST
from torch.utils.data import DataLoader, random_split
# Hyperparameters
batch_size = 128
learning_rate = 0.001
# Other constants
input_size = 28*28
num_classes = 10
Dataset & Data loaders
# Download dataset
dataset = MNIST(root='data/', train=True, transform=transforms.ToTensor(), download=True)