new version of "newtr" function
이전 댓글 표시
Hi everybody I got a code (SRGTSToolbox) that has been written with old version of MATLAB. This is a part of that code:
% CALCULATE ACTUAL ERROR
w1 = p(:,used)';
a1 = radbas(dist(w1,p)*b);
[w2,b2] = solvelin2(a1,t);
a2 = w2*a1 + b2*ones(1,q);
sse = sumsqr(t-a2);
% Start
tr = newtr(mn,'perf');
tr.perf(1) = sumsqr(t);
tr.perf(2) = sse;
As can be seen there is a function called "newtr". What's the updated version of this function in MATLAB 2015? This is a part of radial basis neural network code. Thanks
댓글 수: 10
Zhx Zhx
2020년 2월 14일
I met the same problem. How do you deal with it?
Walter Roberson
2020년 2월 14일
http://cda.psych.uiuc.edu/matlab_pdf/nnet.pdf which is an old copy of the Neural Network Toolbox user guide, has this to say:
Utility Functions.
If you examine training functions such as trainc, traingd, and trainlm, note that they use a set of utility functions found in the nnet/nnutilsdirectory. These functions are not listed in Chapter 14, “Reference” because they may be altered in the future. However, you can use these functions if you are willing to take the risk that you might have to update your functions for future versions of the toolbox. Use help on each function to view the function’s input and output arguments.
These two functions are useful for creating a new training record and truncating it once the final number of epochs is known:
- newtr - New training record with any number of optional fields.
- cliptr - Clip training record to the final number of epochs.
The closest equivalent now appears to be nnetTrainingRecord, but that is not all that close. These days you would set the performFcn to 'sse' . I would have to dig further into toolbox/nnet/nnutils in the + directories to figure out how records of results are kept.
Greg Heath
2020년 2월 14일
편집: Greg Heath
2020년 2월 14일
tr is the training record in
[ net, tr, Y, E] = train( net, P, T );
Is this any help?
Greg
Walter Roberson
2020년 2월 14일
newtr() permitted you to create training records with arbitrary fields and attach values to them in ways that display and summary functions could find.
In context, the code is calculating some measure, and is creating a "perf" record with two associated numeric values, using the same structure that the built-in functions used at the time to record results for later display. It is training with a custom algorithm and storing the results in a way that train() expects.
This is at a lower level than the record that train() creates: it is an internal function.
sourav das
2020년 6월 18일
Can you please provide information, how to solve this problem with new version of MATLAB??
Walter Roberson
2020년 6월 18일
In current versions,
nnetTrainingRecord(net)
can be used to initialize a training record, and then fields of the resulting tr can be set, including field perf
Jiaxing Hu
2021년 1월 24일
Can you please provide the detailed information to solve this problem ? I met the same prolem with yours ,recently.
Walter Roberson
2021년 1월 24일
tr = nnetTrainingRecord(net);
tr.perf(1) = sumsqr(t);
tr.perf(2) = sse;
浩 陈
2022년 6월 8일
Hello, when I set up the program like you, I will find that Cliptr function is not defined, how to solve this problem
Walter Roberson
2022년 6월 8일
You can find the source code for cliptr as part of https://svn-mede.ewi.tudelft.nl/trac/MM-ICT/PRTOOLS/browser/pr_newrb.m
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!