Learn practical skills, build real-world projects, and advance your career

Image Classification with PyTorch

"Traditionally, the only way to get a computer to do something -- from adding two numbers to flying an airplane --was to write down an algorithm explaining how, in painstaking detail. But machine learning, also known as learners, are different: they figure it out on their own, by making inferences from data. And the more data they have, the better the get. Now we don't have to program computers: they program themselves." (from "The Master Algorithm by Pedro Domingo)

Image Classification is a supervised learning problem: define a set of target classes (objects to identify in images), and train a model to recognize them using labeled example photos.

This notebook presents the techniques using PyTorch from the series https://jovian.ai/learn/deep-learning-with-pytorch-zero-to-gans applied to the CIFAR100 dataset.

I learned a lot. I also learned that I just scratched the surface; there's still deep learning and countless hours of training I need before I can comfortably say - yes "I GOT IT!"

!pip install jovian --upgrade --quiet
#import os
import torch
import torchvision
import numpy as np
#import tarfile
import torch.nn as nn
import torch.nn.functional as F
#from torchvision.datasets.utils import download_url
from torchvision.datasets import CIFAR100
#from torchvision.datasets import ImageFolder
from torchvision.transforms import ToTensor
from torchvision.utils import make_grid
from torch.utils.data import random_split
from torch.utils.data import DataLoader

import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

matplotlib.rcParams['figure.facecolor'] = '#ffffff'

CIFAR100 Dataset