MATLAB: What is formula for finding to Number of Weights in Neural Nework with two Hidden Layers

neural network weightsneural networkssynaptic connections

Suppose for neural network with two hidden layers, inputs dimension is "I", Hidden number of neurons in Layer 1 is "H1", Hidden number of neurons in Layer 2 is "H2" And number of outputs is "O", Now what will be the formula for total number of weights in the neural network or total number of synaptic connections?

Best Answer

Nw = (I+1)*H1 +(H1+1)*H2 +(H2+1)*O
Hope this helps.
Greg