Implementing a simple neural network in Keras

From the preceding discussion, we have seen that the key components in a neural network are:

  • Hidden layers
  • Activation in a hidden layer
  • Loss function

Along with these, there are a few other key components in a neural network. However, we will learn about them in a later section.

For now, we will build a neural network model with the given toy dataset in Keras, with the knowledge we've gained in the sections so far:

Import the relevant functions:

The sequential model is a linear stack of layers (input, hidden, and output).

Within each layer, dense helps in implementing the operations specified ...

Get Hands-On Machine Learning on Google Cloud Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.