How to train a neural network to 0.1 error rate?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have written this code to train a neural network with 500 samples as the inputs and 32 attributes.Its a classification problem and i have two classes in the target.
net=fitnet(30,'trainlm');
net.divideParam.trainRatio=.7;
net.divideParam.valRatio=.15;
net.divideParam.testRatio=.15;
[net,tr] = train(net,input500',target500');
Output=net(sample')';
the code is working although the output of the sample isn't perfect yet. I need explanation on how i can calculate error rate after each epoch. Also i want the neural network to continue its training until the error rate is less than 0.1 Please how can i achieve this. Thanks in anticipation.
0 件のコメント
採用された回答
Greg Heath
2016 年 1 月 17 日
1. Error rate cannot be used as a training function because it is discontinuous.
2. PATTERNNET, the current default classification/pattern-recognition function, is more appropriate than FITNET which is designed for regression/curve-fitting. See the documentation
help patternnet
doc patternnet
2. For examples, search BOTH the NEWSGROUP and ANSWERS using
greg patternnet
3. For c classes, the c x N target matrix is obtained from the true class indices 1:c via IND2VEC. The estimated class indices are obtained from the output via VEC2IND. Class error rates are obtained by comparing true and estimated indices.
4. Since it is impossible to directly design for a given error rate, the best approach is, for a given number of hidden nodes, H, make multiple (e.g., Ntrials = 10) designs using different random initial weights.
5. To get a feel for it, start with default value H = 10. Then, use a for loop over H = Hmin:dH:Hmax to try to obtain the smallest value of H that will yield acceptable results. You will have to design at least
Ndesigns = Ntrials*numel(Hmin:dH:Hmax)
6. See previous posts and write back if you need help.
Hope this helps,
Thank you for formally accepting my answer
Greg
2 件のコメント
Greg Heath
2016 年 1 月 24 日
You haven't looked up any of my patternnet posts in either the NEWSGROUP or ANSWERS!!!
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Modeling and Prediction with NARX and Time-Delay Networks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!