O'Reilly logo

Deep Learning with TensorFlow by Ahmed Menshawy, Md. Rezaul Karim, Giancarlo Zaccone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a five-layer neural network

The following implementation increases the network complexity by adding four layers before the softmax layer. To determine the appropriate size of the network, that is, the number of hidden layers and the number of neurons per layer, generally we rely on general empirical criteria, the personal experience, or appropriate tests.

The following table summarizes the implemented network architecture, it shows the number of neurons per layer and the respective activation functions:

Layer Number of neurons Activation function
First L = 200 sigmoid
Second M = 100 sigmoid
Third N = 60 sigmoid
Fourth O = 30 sigmoid
Fifth 10 softmax

The transfer function for the first four layers is the sigmoid ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required