Deciding how many nodes and layers to use in a neutral network: many functions can be expressed in 1 or 2 hidden layers, more is often better and faster, and you usually have to experiment.
https://machinelearningmastery.com/how-to-configure-the-number-of-layers-and-nodes-in-a-neural-network/