Hidden Layer

image.png

In a neural network, a hidden layer refers to any layer that lies between the input layer and the output layer. The term "hidden" indicates that the layer's neurons are not directly observable—they receive inputs from the previous layer and send their outputs to the next layer, but are not part of the external inputs or final outputs.

Hidden layers are crucial because they enable the network to learn abstract representations and hierarchies of features.

How much should I set a number of nodes in a hidden layer?

Short answer: depend on how complex your problem is.

Simple Long answer: 1 node of the Hidden layer represents a “Line”, that classifies a dimension.

Using 1 node of the hidden layer you can create a line that classifies 2 options. as illustrated below.

image.png

using 2 nodes of the hidden layer, you can create 2 lines that classify 2 options. as illustrated below.

image.png

using 3,4,5 and so on, you can make more and more possible classifications.

How much should I set the hidden layer count?

Short answer: depends on how much accuracy you need.

Simple Long answer:

Multi-layer of the hidden layer will do the same as an above case (creating a line of classification) but nested. so the deeper the layer, the better the accuracy. that's why it’s called “Deep Learning”.

But it comes with a drawback, the deeper it is, the more complex the calculation will become and it takes longer time to compute. so you need to take a consideration the performance impact, especially in game development.