Machine Learning with PyTorch and Scikit-Learn
-- Code Examples
Package version checks
Add folder to path in order to load from the check_packages.py script:
Check recommended package versions:
Chapter 11 - Implementing a Multi-layer Artificial Neural Network from Scratch
Overview
Modeling complex functions with artificial neural networks
...
Single-layer neural network recap
Introducing the multi-layer neural network architecture
Activating a neural network via forward propagation
Classifying handwritten digits
...
Obtaining and preparing the MNIST dataset
The MNIST dataset is publicly available at http://yann.lecun.com/exdb/mnist/ and consists of the following four parts:
Training set images: train-images-idx3-ubyte.gz (9.9 MB, 47 MB unzipped, 60,000 examples)
Training set labels: train-labels-idx1-ubyte.gz (29 KB, 60 KB unzipped, 60,000 labels)
Test set images: t10k-images-idx3-ubyte.gz (1.6 MB, 7.8 MB, 10,000 examples)
Test set labels: t10k-labels-idx1-ubyte.gz (5 KB, 10 KB unzipped, 10,000 labels)
Normalize to [-1, 1] range:
Visualize the first digit of each class:
Visualize 25 different versions of "7":
Split into training, validation, and test set:
Implementing a multi-layer perceptron
Coding the neural network training loop
Defining data loaders:
Defining a function to compute the loss and accuracy
Evaluating the neural network performance
Plot failure cases:
Training an artificial neural network
...
Computing the loss function
Developing your intuition for backpropagation
...
Training neural networks via backpropagation
Convergence in neural networks
...
Summary
...
Readers may ignore the next cell.