Skip to Content
Neural Network Projects with Python
book

Neural Network Projects with Python

by James Loy
February 2019
Beginner to intermediate
308 pages
7h 42m
English
Packt Publishing
Content preview from Neural Network Projects with Python

Effect of hidden layer size on autoencoder performance

Let's try training more autoencoders with different hidden layer sizes and see how they fare.

The following code creates and trains five different models with 2, 4, 8, 16, and 32 nodes in the hidden layer:

hiddenLayerSize_2_model = create_basic_autoencoder(hidden_layer_size=2)hiddenLayerSize_4_model = create_basic_autoencoder(hidden_layer_size=4)hiddenLayerSize_8_model = create_basic_autoencoder(hidden_layer_size=8)hiddenLayerSize_16_model = create_basic_autoencoder(hidden_layer_size=16)hiddenLayerSize_32_model = create_basic_autoencoder(hidden_layer_size=32)

Notice how each successive model has twice the number of nodes in the hidden layer as the preceding model.

Now, let's train all ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning with Python Cookbook

Machine Learning with Python Cookbook

Chris Albon

Publisher Resources

ISBN: 9781789138900Supplemental Content