Deciding on the hidden layers and neurons

Multilayer perceptrons provide only a few choices during the model design process: the activation function used in the hidden layers, the number of hidden layers, and the number of nodes or artificial neurons in each layer. The topic of selecting the optimal number of layers and nodes will be covered in this section. We can begin with a single layer and use a set of heuristics to guide our starting point for selecting the number of nodes to include in this hidden layer.

When beginning this process, a good starting point is 66% of the length of the input or the number of independent variable columns. This value, in general, will fall within a range between the size of the output to two times the size ...

Get Hands-On Deep Learning with R now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.