I am developing a multi Layered neural network for my study. But now I am in a fix where, a user should define the number of hidden layers he wants and the number of neurons in each layer. My inputs are of the matrix (x,8) and my actual output is of the matrix (x,2) where x is the number of rows in my sample data.
I usually define my weights as
Weights1 = 2 * np.random.random((Hidden_layer_len,X[0].shape[0])) - 1
Weights2 = 2 * np.random.random((T[0].shape[0],Hidden_layer_len)) - 1
W = [Weights1, Weights2]
where X is the input, T is the output from the sample datasheet and Hidden_layer_len is the length of the hidden layer, assuming there is one hidden layer between my input and output.
Now, my requirement is that, a user can provide the number of hidden layer he wants between the input and output and the user can also define the number of neurons (hidden_layer_len) of each layer.
assuming that there are n layers, how do i create my weights for the n layers and the number of neurons in each layer?