aadarshjha / LearningPyTorch1.x

Collection of Colab notebooks for learning pytorch (NN, CNN, MNIST, CIFAR-10, Transfer learning, etc).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learning PyTorch 1.x Notebooks

1) Getting Started with PyTorch: Training a Neural Network on MNIST

In this notebook, we will train a neural network (1 input layer, 1 hidden layer, 1 output layer) to classify handwritten digits. We use the Module as our container from the torch.nn module. We'll be training our neural network on the MNIST, which is the "hello world" of Machine learning and Deep learning algoriths:

notebook: (nbviewer) (github) (colab)

2) Introduction to Convolutional Neural Networks and Deep Learning

Similar to artificial neural networks, convolutional neural networks consist of artificial neurons organized in layers. Convolutional neural networks (convnets or CNNs for short), however, introduced the concept of convolution to automatically extract features that then are fed to a classifier of fully connected neurons.

In this notebook, we build a convolutional neural network from zero and train it on the MNIST dataset.

notebook: (nbviewer) (github) (colab)

3) Plotting Accuracy and Loss for CNNs with PyTorch

Part of the work that involves designing and training deep neural networks, consists in plotting the various parameters and metrics generated in the process of training. In this notebook we will design and train our Convnet from scratch, and will plot the training vs. test accuracy, and the training vs. test loss.

These are very important metrics, since they will show us how well is doing our neural network.

notebook: (nbviewer) (github) (colab)

4) CIFAR-10: A More Challenging Dataset for CNNs

So far we have trained our neural networks on the MNIST dataset, and have achieved high acurracy rates for both the training and test datasets. Now we train our Convnet on the CIFAR-10 dataset, which contains 60,000 images of 32x32 pixels in color (3 channels) divided in 10 classes (airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck).

As we'll see in this notebook, the CIFAR-10 dataset will prove particularly challenging for our very basic Convnet, and from this point we'll start exploring the world of pretrained neural networks.

notebook: (nbviewer) (github) (colab)

5) Pretrained Convolutional Neural Networks

Pretrained Convnets have been trained on large datasets such as Imagenet and are available for downloading (including the architecture/layers and its parameters/weights).

We will see that it's possible to tweak a pretrained convolutional neural network and transfer its "learning" to our problem.

In this notebook, we will explore the convnet ResNet18 and we will take a look at its structure and number of parameters. Also we will discuss what it means to freeze and unfreeze a layer.

notebook: (nbviewer) (github) (colab)

About

Collection of Colab notebooks for learning pytorch (NN, CNN, MNIST, CIFAR-10, Transfer learning, etc).


Languages

Language:Jupyter Notebook 100.0%