필터 지우기
필터 지우기

More than one hidden layer

조회 수: 3 (최근 30일)
Rafa
Rafa 2011년 11월 6일
Hi, I am using the command net =newff(p,t,3);
So, my neural netwok has one hidden layer with 3 neurons.How can i increase the number of hiiden layers?
And how can change the activations functions from default?
Please i need an example.
Thanks
  댓글 수: 2
Nduwamungu Corneille
Nduwamungu Corneille 2013년 6월 3일
Hi Rafa, have you managed to solve the default single hidden layer issue? Thank you. Corneille
Greg Heath
Greg Heath 2013년 6월 4일
See my answer.
Greg Heath

댓글을 달려면 로그인하십시오.

채택된 답변

Greg Heath
Greg Heath 2011년 11월 23일
Dimitris used the older version of newff
net = newff(minmax(p),[H1 H2 O],{'tansig' 'tansig' 'tansig'});
for a net with I-H1-H2-O node topology. The newer version is
net = newff(p,t,[H1 H2],{'tansig' 'tansig' 'tansig'});
Hope this helps.
Greg

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 11월 6일
I am definitely not an expert on this, but my interpretation of the documentation is that the number of layers is strictly determined by size(t,1). If that is correct, then to increase the number of hidden layers, you would have to increase the number of rows in t .
The users guide appears to suggest that all but the last layer are "hidden" layers and the last layer is not hidden, but the reference page above shows an example with a single row T (thus only one layer) and indicates that that creates a network with one hidden layer when my interpretation would instead suggest no hidden layer would be created. The possible conclusions are that either I have misunderstood the documentation or else that (by convention?) a single row input will lead to a two layer network with the first layer hidden and the second layer being the output layer.
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 11월 6일
The documentation I cited (the R2010a reference page for newff) does not say that.
On the other hand, reading again, I believe I was wrong about the number of layers being determined by the number of rows. Instead, in now appears to me that the number of layers is one more than the number of size (Si) parameters that you provide. Thus,
newff(p,t,[3 3])
would, I think, create two hidden layers both with 3 neurons.
Rafa
Rafa 2011년 11월 7일
I wrote a comment to Dimitris.
Take a look please!
Thank you!

댓글을 달려면 로그인하십시오.


Dimitris
Dimitris 2011년 11월 6일
Try that for a 10:3:3:5 NN with specific activation functions.The range of input is [-1,1].
net=newff([-1 1; -1 1; -1 1; -1 1; -1 1; -1 1; -1 1; -1 1; -1 1; -1 1], [3 3 5],{'tansig','tansig','tansig'},'trainlm');
  댓글 수: 1
Rafa
Rafa 2011년 11월 6일
According to the documentation from the help of Matlab R2008a:
newff (P, T, [S1 S2 ... S (Nl)], {TF1 TF2 ... TFNl}, BTF, BLF, PF, IPF, OPF, DDF) Several arguments takes
He did not cite how to put more than one hidden layer and therefore ask for help.
[.. S1 S2 S (N-1)] is the size of the hidden layer.
This help is also cited an example of newff net = (P, T, 5), where five neurons are created in a single hidden layer set to default.
Dimitri, until I realized that you put the ranges of input neurons and you only desceveria matrices of input and output in the training ne? But that is not quoted in the Matlab help for the command newff.
I still need help with examples on how to place two or more hidden layers using newff.
thank you

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by