I have got some problems writing my simple neural network. I was learning about neural networks in python by "Neural network in 11 lines" guide (https://www.kdnuggets.com/2015/10/neural-network-python-tutorial.html). There was 2D array as input (in first dimension was example number, and in second - example) As an output there was a 1D array. So now I tried to do something similar. I had input array for learning with 1000 examples and each example has 64 neurons:
n0 = np.zeros((1000, 64))
After that I filled array with data from dataset. My weights were like:
w0 = 2 * np.random.random((64, 120))-1
w1 = 2 * np.random.random((120, 240))-1
w2 = 2 * np.random.random((240, 240))-1
w3 = 2 * np.random.random((240, 240))-1
w4 = 2 * np.random.random((240, 120))-1
w5 = 2 * np.random.random((120, 44))-1
And forward-function was:
n1 = sigmoid(np.dot(n0, w0))
n2 = sigmoid(np.dot(n1, w1))
#...
n6 = sigmoid(np.dot(n5, w5))
After that n6 size is 1000x44. And how can I get 1D array, not 2D array? Also after weights correction, neurons can get strange numbers like 6.72853722e-172... And in n6 answers are 1.00000000e+000 and 0.00000000e-000, how that could be after sigmoid function?
np.flatten()to convert to a 1D array or add another layer with fewer nodes at the end.