What is this line of code after the summary doing? And how did we decide 2*3+3 and 3*1+1

Can anybody please explain it to me?

Hi @Sparsh22

This line show how many parameters in every layer in the first hidden layer we have 2 input and we have 3 neuron every neuron have (w1,w2, and b bias term) why w1, and w2 only as we have 2 inputs (x1,x2)so that when we get the z_values(linear value of neuron) = x1w1+x2w2+b to give this value to the activation(nonlinearity)function, so that we have 2 input and the first layer have 3 neurons so that each neuron of these 3 neurons has (w1,w2,b) so to calculate the number of weights of each layer we multiply the number of inputs(that represent the weights w1 ,w2 here equal 2) with the number of neurons(here equal 3) and after that we plus the number of neurons that represent the bias term of each neuron(here equal 3) = 9 in the first layer …the number of parameters we want to calculate in the second hidden layer = 3 (number of input from the previous layer which is equal number of neurons in the first layer ) * (number of neurons in this[second hidden] layer) + 1(number of the neurons in the second hidden layer [bias term b])


Frankly, that code really does nothing useful other than compute a few example numbers. It might be more useful if the numbers were computed from the model itself.