Newbie question on how to change default settings for feedforwardnet

조회 수: 2 (최근 30일)
Jo John
Jo John 2012년 7월 22일
댓글: Image Analyst 2013년 10월 29일
I am learning neural networks via MATLAB 2012a, I followed some examples. In one of the examples I found internet, create a feed forward net with 2 hidden layers, the first layer has 3 neurons and the second layer has 1 neuron. From the default feed forward net created by: net = feedforwardnet I can see there are 2 hidden layers, but I can not see how many neurons are there in each layer.
Please advice how I can find the settings in each layer for how many neurons are in the layer? Besides, how I can change it?
I found an old syntax seems to be able to do this quite easily: net = newff([1969, 1989; 1,12], [3, 1], {‘tangsig’, ‘purelin’}, traind) However, in MATLAB 2012a, the above syntax is obsolete, please let me know how I can do the same job with feedforwardnet?
Thanks, John

채택된 답변

Greg Heath
Greg Heath 2012년 7월 25일
1. Your example only has 1 hidden layer. The other layer is the output layer. I sincerely doubt that you will ever have to use two hidden layers.
For two hidden layers:
newff([minmax(x),t,[H1 H2 O],...)% Ancient ( O = size(t,1) )
newff(x,t,[H1 H2],...) % Very Old
newfit(x,t,[H1 H2],...) % Old
fitnet(x,t,[H1 H2],...) % Current
2. If you have 2012a
a. Forget about feedforwardnet (automatically called by fitnet and patternnet)
b. Use fitnet for regression and curvefitting
c. Use patternnet for pattern recognition and classification
3. Read the documentation to better understand
help fitnet
doc fitnet
help/doc patternnet
help/doc feedforwardnet
help/doc newff
4. Run some of the examples and/or demos WITH THE ENDING SEMICOLONS REMOVED!
5. Study the resulting command line output.
Hope this helps.
Greg
  댓글 수: 2
huang
huang 2013년 10월 17일
thank you!very detail answer
Image Analyst
Image Analyst 2013년 10월 29일
I marked Greg's answer as Accepted, because you forgot to.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by