Back to Annotated Deep Learning Paper Implementations

Mnist

labml_nn/normalization/batch_norm/mnist.ipynb

latest1.2 KB
Original Source

Batch Normaliztion

This trains is a simple convolutional neural network that uses batch normalization to classify MNIST digits.

Install the labml-nn package

!pip install labml-nn

Imports

import torch
from labml import experiment
from labml_nn.normalization.batch_norm.mnist import MNISTConfigs

Create an experiment

experiment.create(name="mnist_batch_norm")

Initialize configurations

conf = MNISTConfigs()

Set experiment configurations and assign a configurations dictionary to override configurations

experiment.configs(conf, {'optimizer.optimizer': 'Adam'})

Start the experiment and run the training loop.

with experiment.start():
    conf.run()