Run the entire notebook end-to-end and check out the outputs.
This will open Python files in the right-hand editor!
You'll be able to interactively explore metrics in TensorBoard.
Change config and train for different hyperparameters. Check out the
updated TensorBoard plots.
Update the code in train.py. Thanks to %autoreload, any changes you
make in the file will automatically appear in the notebook. Some ideas to
get you started:
Change the model.
Log some per-batch metrics during training.
Add new hyperparameters to configs/default.py and use them in
train.py.
At any time, feel free to paste code from train.py into the notebook
and modify it directly there!
Setup
[1]
Ctrl+Kto generate
|███▊ | 10kB 21.5MB/s eta 0:00:01
|███████▍ | 20kB 12.7MB/s eta 0:00:01
|███████████ | 30kB 9.4MB/s eta 0:00:01
|██████████████▉ | 40kB 8.4MB/s eta 0:00:01
|██████████████████▌ | 51kB 5.2MB/s eta 0:00:01
|██████████████████████▏ | 61kB 5.2MB/s eta 0:00:01
|█████████████████████████▉ | 71kB 5.7MB/s eta 0:00:01
|█████████████████████████████▋ | 81kB 6.3MB/s eta 0:00:01
|████████████████████████████████| 92kB 4.4MB/s
|████████████████████████████████| 634kB 8.5MB/s
|████████████████████████████████| 102kB 6.0MB/s
|████████████████████████████████| 61kB 6.3MB/s
Building wheel for flax (setup.py) ... done
Building wheel for jax (setup.py) ... done
INFO:absl:Load pre-computed DatasetInfo (eg: splits, num examples,...) from GCS: mnist/3.0.1
INFO:absl:Load dataset info from /tmp/tmpqyu1t56xtfds
INFO:absl:Field info.citation from disk and from code do not match. Keeping the one from code.
INFO:absl:Generating dataset mnist (/root/tensorflow_datasets/mnist/3.0.1)
Downloading and preparing dataset mnist/3.0.1 (download: 11.06 MiB, generated: 21.00 MiB, total: 32.06 MiB) to /root/tensorflow_datasets/mnist/3.0.1...
WARNING:absl:Dataset mnist is hosted on GCS. It will automatically be downloaded to your
local data directory. If you'd instead prefer to read directly from our public
GCS bucket (recommended if you're running on GCP), you can instead pass
`try_gcs=True` to `tfds.load` or set `data_dir=gs://tfds-data/datasets`.
INFO:absl:Load dataset info from /root/tensorflow_datasets/mnist/3.0.1.incompleteJ6TJES
INFO:absl:Field info.citation from disk and from code do not match. Keeping the one from code.
INFO:absl:Constructing tf.data.Dataset for split train, from /root/tensorflow_datasets/mnist/3.0.1
Dataset mnist downloaded and prepared to /root/tensorflow_datasets/mnist/3.0.1. Subsequent calls will reuse this data.
INFO:absl:Constructing tf.data.Dataset for split test, from /root/tensorflow_datasets/mnist/3.0.1
[9]
Ctrl+Kto generate
Training
[ ]
Ctrl+Kto generate
[11]
Ctrl+Kto generate
INFO:absl:Load dataset info from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:Field info.citation from disk and from code do not match. Keeping the one from code.
INFO:absl:Reusing dataset mnist (/root/tensorflow_datasets/mnist/3.0.1)
INFO:absl:Constructing tf.data.Dataset for split train, from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:Constructing tf.data.Dataset for split test, from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:train epoch: 1, loss: 0.2352, accuracy: 92.94
INFO:absl:eval epoch: 1, loss: 0.0592, accuracy: 98.00
INFO:absl:train epoch: 2, loss: 0.0584, accuracy: 98.15
INFO:absl:eval epoch: 2, loss: 0.0575, accuracy: 98.14
INFO:absl:train epoch: 3, loss: 0.0423, accuracy: 98.66
INFO:absl:eval epoch: 3, loss: 0.0357, accuracy: 98.78
INFO:absl:Load dataset info from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:Field info.citation from disk and from code do not match. Keeping the one from code.
INFO:absl:Reusing dataset mnist (/root/tensorflow_datasets/mnist/3.0.1)
INFO:absl:Constructing tf.data.Dataset for split train, from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:Constructing tf.data.Dataset for split test, from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:train epoch: 1, loss: 0.2745, accuracy: 91.83
INFO:absl:eval epoch: 1, loss: 0.0478, accuracy: 98.36
INFO:absl:train epoch: 2, loss: 0.0508, accuracy: 98.42
INFO:absl:eval epoch: 2, loss: 0.0382, accuracy: 98.81
INFO:absl:train epoch: 3, loss: 0.0374, accuracy: 98.85
INFO:absl:eval epoch: 3, loss: 0.0264, accuracy: 99.09
INFO:absl:Load dataset info from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:Field info.citation from disk and from code do not match. Keeping the one from code.
INFO:absl:Reusing dataset mnist (/root/tensorflow_datasets/mnist/3.0.1)
INFO:absl:Constructing tf.data.Dataset for split train, from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:Constructing tf.data.Dataset for split test, from /root/tensorflow_datasets/mnist/3.0.1
INFO:absl:train epoch: 1, loss: 0.2676, accuracy: 91.85
INFO:absl:eval epoch: 1, loss: 0.0485, accuracy: 98.57
INFO:absl:train epoch: 2, loss: 0.0483, accuracy: 98.54
INFO:absl:eval epoch: 2, loss: 0.0461, accuracy: 98.64
INFO:absl:train epoch: 3, loss: 0.0341, accuracy: 98.91
INFO:absl:eval epoch: 3, loss: 0.0396, accuracy: 98.74