How many parameters does the neural network have? We have a neural network with an input layer of ℎ0 nodes, hidden layers of ℎ1 , ℎ2 , ℎ3 , ..., ℎ−1 nodes respectively and an output layer of ℎ nodes. 
        How many parameters does the network have?
Suppose the network has $784$ inputs, $16$ nodes in $2$ hidden layers and $10$ nodes in the output layer.
The amount of parameters (meaning weights and bias that make up the cost function) is then:
For the weights:
$$784\times 16+16\times16+16\times10=12960$$
For the bias components:
We have $32$ neurons in the hidden layers and $10$ in the output, so we have $$32+10 = 42$$ biases.
So in total, the amount of parameters in this neural network is $13002$.
for simplicity lets say the $l=5$
clearly we have,
           i=h0        //inputs
           h=[h1,h2,h3,h4]   //hidden layers
           o=h5             //output

therefore the no of params $= (h0*h1 + h1*h2 + h2*h3 + h4*h5) + [h1+h2+h3+h4+h5]$
=click here to view the expression