How to Configure the Number of Layers and Nodes in a Neural Network

Last Updated on August 6, 2019

Artificial neural networks have two main hyperparameters that control the architecture or topology of the network: the number of layers and the number of nodes in each hidden layer.

You must specify values for these parameters when configuring your network.

The most reliable way to configure these hyperparameters for your specific predictive modeling problem is via systematic experimentation with a robust test harness.

This can be a tough pill to swallow for beginners to the field of machine learning, looking for an analytical way to calculate the optimal number of layers and nodes, or easy rules of thumb to follow.

In this post, you will discover the roles of layers and nodes and how to approach the configuration of a multilayer perceptron neural network for your predictive modeling problem.

After reading this post, you will know:

  • The difference between single-layer and multiple-layer perceptron networks.
  • The value of having one and more than one hidden layers in a network.
  • Five approaches for configuring the number of layers and nodes in a network.

Kick-start your project with my new book Better Deep Learning, including step-by-step tutorials and the Python source code files for
To finish reading, please visit source site