In our previous tutorials, we built an automatic differentiation framework by implementing a dynamic construction of computation graphs and automatc backpropagation in arbitrary computation graphs. As an illustration how that allows us to train machine learning models, we want to put this framework practice by training a neural network to classify MNIST digits.
from sklearn.utils import shuffle
from sklearn.datasets import fetch_openml
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
import numpy as np
from tqdm import tqdm, trange
import matplotlib.pyplot as plt