Path: blob/master/notebooks/book2/21/ae_mnist_conv_jax.ipynb
1193 views
Kernel: Python 3 (ipykernel)
Autoencoder using CNN for MNIST
Install dependencies
In [1]:
Out[1]:
|████████████████████████████████| 197 kB 35.4 MB/s
|████████████████████████████████| 596 kB 64.1 MB/s
|████████████████████████████████| 140 kB 72.2 MB/s
|████████████████████████████████| 217 kB 74.3 MB/s
|████████████████████████████████| 51 kB 7.3 MB/s
|████████████████████████████████| 72 kB 563 kB/s
Model Definition
In [2]:
Training/evaluation functions
In [3]:
Hyperparameters
In [4]:
Out[4]:
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to /tmp/MNIST/raw/train-images-idx3-ubyte.gz
0%| | 0/9912422 [00:00<?, ?it/s]
Extracting /tmp/MNIST/raw/train-images-idx3-ubyte.gz to /tmp/MNIST/raw
Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to /tmp/MNIST/raw/train-labels-idx1-ubyte.gz
0%| | 0/28881 [00:00<?, ?it/s]
Extracting /tmp/MNIST/raw/train-labels-idx1-ubyte.gz to /tmp/MNIST/raw
Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to /tmp/MNIST/raw/t10k-images-idx3-ubyte.gz
0%| | 0/1648877 [00:00<?, ?it/s]
Extracting /tmp/MNIST/raw/t10k-images-idx3-ubyte.gz to /tmp/MNIST/raw
Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to /tmp/MNIST/raw/t10k-labels-idx1-ubyte.gz
0%| | 0/4542 [00:00<?, ?it/s]
Extracting /tmp/MNIST/raw/t10k-labels-idx1-ubyte.gz to /tmp/MNIST/raw
Training loop
In [5]:
Out[5]:
Epoch 0: train loss 1924728.125
Epoch 1: train loss 921209.6875
Epoch 2: train loss 708391.1875
Epoch 3: train loss 621599.8125
Visualization of reconstructed images
In [6]:
Out[6]:
Visualization of latent space with t-SNE
In [7]:
In [8]:
Out[8]:
In [8]: