I spent the past 3 hours trying to create a feed-forward neural network in matlab with no success. It's really confusing for me now.
I am trying to create the following neural network:
- The input layer has 122 features/inputs,
- 1 hidden layer with 25 hidden units,
- 1 output layer (binary classification),
- Input layer and Hidden layer have bias units (Please see the image below for a general idea)
But from my analysis of the network
function, I can't understand how I am going to specify 25 hidden units or neurons in my single hidden layer, and how I can make all of the input layer neurons connected to these hidden unit.
net = network(numInputs,numLayers,biasConnect,inputConnect,layerConnect,outputConnect);
For example if I want to create a neural network with 5 inputs and 5 hidden units in the hidden layer (including the bias units) and make it fully connected. I am using this code:
net = network(5,1,1,[1 1 1 1 1],0,1);
which output this:
From my understanding my code has the following problems:
- There is no bias inputs in the input layer
- it's not a fully connected network (it's like one neuron is connected to only on hidden neuron)
So please, I have put my cards on the table, how can I do it?