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

Classifying images of everyday objects using a neural network

The ability to try many different neural network architectures to address a problem is what makes deep learning really powerful, especially compared to shallow learning techniques like linear regression, logistic regression etc.

In this assignment, you will:

  1. Explore the CIFAR10 dataset: https://www.cs.toronto.edu/~kriz/cifar.html
  2. Set up a training pipeline to train a neural network on a GPU
  3. Experiment with different network architectures & hyperparameters

As you go through this notebook, you will find a ??? in certain places. Your job is to replace the ??? with appropriate code or values, to ensure that the notebook runs properly end-to-end. Try to experiment with different network structures and hypeparameters to get the lowest loss.

You might find these notebooks useful for reference, as you work through this notebook:

# Uncomment and run the commands below if imports fail
# !conda install numpy pandas pytorch torchvision cpuonly -c pytorch -y
!pip install matplotlib --upgrade --quiet --user
import torch
import torchvision

import numpy as np
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.nn.functional as F
from torchvision.datasets import CIFAR10
from torchvision.transforms import ToTensor
from torchvision.utils import make_grid
from torch.utils.data.dataloader import DataLoader
from torch.utils.data import random_split
%matplotlib inline
conda install -f matplotlib
Collecting package metadata (current_repodata.json): ...working... done Solving environment: ...working... done ## Package Plan ## environment location: C:\Users\Abhi\Anaconda3 added / updated specs: - matplotlib Preparing transaction: ...working... done Verifying transaction: ...working... done Executing transaction: ...working... done Rolling back transaction: ...working... done
WARNING: The --force flag will be removed in a future conda release. See 'conda install --help' for details about the --force-reinstall and --clobber flags. SafetyError: The package for matplotlib located at C:\Users\Abhi\Anaconda3\pkgs\matplotlib-3.1.1-py37hc8f65d3_0 appears to be corrupted. The path 'Lib/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans.ttf' has an incorrect size. reported size: 756072 bytes actual size: 0 bytes ERROR conda.core.link:_execute(700): An error occurred while installing package 'defaults::matplotlib-3.1.1-py37hc8f65d3_0'. [Errno 13] Permission denied: 'C:\\Users\\Abhi\\Anaconda3\\Lib\\site-packages\\matplotlib\\_image.cp37-win_amd64.pyd' ()
Note: you may need to restart the kernel to use updated packages.
# Project name used for jovian.commit
project_name = 'Assignment 3'