Building a deep neural network in Keras

Changing our model is as easy as redefining our previous build_network() function. Our input layer will stay the same because our input hasn't changed. Likewise, the output layer should remain the same.

I'm going to add parameters to our network by adding additional hidden layers. I hope that by adding these hidden layers, our network can learn more complicated relationships between the input and output. I am going to start by adding four additional hidden layers; the first three will have 32 neurons and the fourth will have 16. Here's what it will look like:

And here's the associated code for building ...

Get Deep Learning Quick Reference 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.