# How many parameters are in my neural network?

I am trying to build an ANN model with 1 hidden layer ( 4 hidden units ) that is capable of learning non-linear regression.

Both X and Y in my training data are in 1D with 60 samples and the data is non-linear.

I am kind of confused in terms of the shape of the weights and the number of neurons I will have in my network.

So, my understanding is:

• 1 input neuron (because my X is in 1D) with [60,1] shape

• 4 hidden neuron (as stated above)

• 1 output neuron with [60,1] shape

• 4 weights in the first layer (weights from input to hidden)

• 5 (including bias) weights in the second layer (weights from hidden to output)

Is this reasoning makes sense? If it does not, how should I think this through?

Thank you.

• If you have doubt, write out the matrix-vector multiplication for a single sample. Suppose the sample has $k$ features. What shapes do you need to have for weights and biases in order for the arithmetic to work out? (I'm not trying to be obscure or coy -- It's important to understand how network size is ultimately related to linear algebra.)
– Sycorax
Dec 6, 2020 at 17:33