Reader small image

You're reading from  Hands-On Neural Networks with Keras

Product typeBook
Published inMar 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789536089
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Niloy Purkait
Niloy Purkait
author image
Niloy Purkait

Niloy Purkait is a technology and strategy consultant by profession. He currently resides in the Netherlands, where he offers his consulting services to local and international companies alike. He specializes in integrated solutions involving artificial intelligence, and takes pride in navigating his clients through dynamic and disruptive business environments. He has a masters in Strategic Management from Tilburg University, and a full specialization in data science from Michigan University. He has advanced industry grade certifications from IBM, in subjects like signal processing, cloud computing, machine and deep learning. He is also perusing advanced academic degrees in several related fields, and is a self-proclaimed lifelong learner.
Read more about Niloy Purkait

Right arrow

Implementing dropout regularization in Keras

In Keras, adding a dropout layer is also very simple. All you are required to do is use the model.add() parameter again, and then specify a dropout layer (instead of the dense layer that we've been using so far) to be added. The Dropout parameter in Keras takes a float value that refers to the fraction of neurons whose predictions will be dropped. A very low dropout rate might not provide the robustness we are looking for, while a high dropout rate simply means we have a network prone to amnesia, incapable of remembering any useful representations. Once again, we strive for a dropout value that is just right; conventionally, the dropout rate is set between 0.2 and 0.4:

#Simple feed forward neural network
model=Sequential()

#feeds in the image composed of 28 28 a pixel matrix as one sequence of 784
model.add(Flatten(input_shape=(28...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Neural Networks with Keras
Published in: Mar 2019Publisher: PacktISBN-13: 9781789536089

Author (1)

author image
Niloy Purkait

Niloy Purkait is a technology and strategy consultant by profession. He currently resides in the Netherlands, where he offers his consulting services to local and international companies alike. He specializes in integrated solutions involving artificial intelligence, and takes pride in navigating his clients through dynamic and disruptive business environments. He has a masters in Strategic Management from Tilburg University, and a full specialization in data science from Michigan University. He has advanced industry grade certifications from IBM, in subjects like signal processing, cloud computing, machine and deep learning. He is also perusing advanced academic degrees in several related fields, and is a self-proclaimed lifelong learner.
Read more about Niloy Purkait