Learn practical skills, build real-world projects, and advance your career
Updated 2 years ago
Image Classification with Logistic Regression (Minimal)
# Uncomment and run the commands below if imports fail # !conda install numpy pytorch torchvision cpuonly -c pytorch -y # !pip install matplotlib --upgrade --quiet !pip install jovian --upgrade --quiet
WARNING: You are using pip version 20.1; however, version 20.1.1 is available. You should consider upgrading via the '/opt/conda/bin/python3.7 -m pip install --upgrade pip' command.
# 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 random_split from torch.utils.data import DataLoader
# Hyperparmeters batch_size = 128 learning_rate = 0.001 # Other constants input_size = 28*28 num_classes = 10