Search⌘ K

Playground (Keras)

Explore building neural networks from scratch using Keras in this practical lesson. Learn how to load and preprocess the MNIST dataset, configure model layers, and train with different optimizers. Understand performance trade-offs and how to achieve high accuracy in a simpler and faster environment compared to manual implementations.

We'll cover the following...

Revision

Before we move on, let’s practice the code for a little while. That’s optional, but it’s a good way to revise these concepts.

Go through all the codes which we have covered in this chapter by launching the below app:

Please login to launch live app!

Hands on

Let’s take the MNIST network we built in Part II of this course and rewrite it from the beginning using Keras.

Keras already comes with a few common datasets, MNIST included, so we don’t have to use our mnist.py library. Instead, we can load MNIST and one-hot encode its labels with this piece of code:

from keras.datasets import mnist
from tensorflow.keras.utils import
...