How to add 2 or more hidden layer to the neural network?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have this code i need to add 2 hidden layer, can anyone please help me with that please. Here is the code
[J,grad] = netcost(nn_params,input_layer_size,hidden_layer_size,num_labels,X, y, lambda)
Theta1 = reshape(nn_params(1:hidden_layer_size * (input_layer_size + 1)), ... hidden_layer_size, (input_layer_size + 1));
Theta2 = reshape(nn_params((1 + (hidden_layer_size * (input_layer_size + 1))):end), ... num_labels, (hidden_layer_size + 1));
num_labels=2; 1 hidden layer; input neurons=2160,hidden layer neuron=20; I want to add totally 2 hidden layers, please can anyone help me with the code please
9 Kommentare
Philip G
am 20 Apr. 2017
Bearbeitet: Philip G
am 20 Apr. 2017
Just executing the command
net=feedforwardnet([200 200 200]);
Does not give any errors and will give you a network with 3 hidden layers of size 200 (see attached image). I am not sure what your error is. Also in the code above "netcost" is not a MATLAB function - so it is hard to say where your error comes from (especially this strange behavior that you can not create a network with a layer size bigger than 100).
Antworten (0)
Siehe auch
Kategorien
Mehr zu Define Shallow Neural Network Architectures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!