layer in neural network

3 次查看(过去 30 天)
Monika
Monika 2015-1-22
评论: Greg Heath 2016-2-28
In code is write
hiddenLayerSize=200 net.divideParam.trainRatio=70/100 net.divideParam.valRatio=15/100 net.divideParam.testRatio=15/100
What does it mean? Where can I find answer?
how many Layer is in network ? What determines the number of layers and what affects?

采纳的回答

Greg Heath
Greg Heath 2015-1-23
Two of the most important uses for Neural Networks are regression(function approximation, curvefitting) and classification/pattern-recognition.
The best way to design NNs is via the Neural Network Toolbox
In general, the best function to use for regression is FITNET. Start with the help and doc documentation using the command line commands
help fitnet
doc fitnet
Next check out some of my posts on the NEWSGROUP and ANSWERS. Search using
greg fitnet
In general, the best function to use for classification/pattern-recognition is PATTERNNET. Start with the help and doc documentation using the command line commands
help patternnet
doc patternnet
Next check out some of my posts on the NEWSGROUP and ANSWERS. Search using
greg patternnet
Finally, use MATLAB data to practice with
help nndatasets
doc nndatasets
If you have problems, it is easier for us to help if you use those datasets.
The help and doc examples use as many default settings as possible. Therefore my best advice for beginners is to begin your designs similarly with one exception. Since by default, the trn/val/tst data division and initial weights are chosen randomly, it is important to know the initial state of the random number generator. The best way to do that is for you to set it to your favorite state before using TRAIN. If designing multiple designs in a loop, initialize RNG before the loop.
help rng
doc rng
The default topology is I-H-O ( H=10 default) for I dimensional input vectors and corresponding O-dimensional Output target vectors. The one hidden layer contains H=10 hidden nodes containing tansig (tanh) transfer functions.
The one hidden layer net is a universal approximator. Increasing the number of hidden nodes increases the ability to model more complex functions. However using more than needed decreases the ability to operate well on unseen data. The only reason to use more layers is if you want to decrease the total number of hidden nodes or, to try to model subclasses for classification.
hiddenLayerSize=200
Replaces the 10 tansig hidden units with 200. Typically, this is a ridiculous number.
net.divideParam.trainRatio=70/100
net.divideParam.valRatio=15/100
net.divideParam.testRatio=15/100
Divides the data into training, validation and test subsets with the ratio 70/15/15. However, this is the default ratio. Therefore those statements can be deleted.
Hope this helps.
Thank you for formally accepting my answer
Greg

更多回答(1 个)

Monika
Monika 2015-1-24
编辑:Monika 2015-1-24
I understand, that as many times as I have in the code
hiddenLayerSize
I have so many hidden layers.
For example:
hiddenLayerSize=10
hiddenLayerSize=15
hiddenLayerSize=30
I have 3 hidden layer
  1 个评论
Greg Heath
Greg Heath 2016-2-28
No!!!
hiddenlayerSize = [ 10 15 30 ]
Hope this helps.
PS for good generalization to unseen data, minimize the number of hidden nodes.
Hope this helps.
Greg

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by