new version of "newtr" function
Show older comments
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 Comments
Zhx Zhx
on 14 Feb 2020
I met the same problem. How do you deal with it?
Walter Roberson
on 14 Feb 2020
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
on 14 Feb 2020
Edited: Greg Heath
on 14 Feb 2020
tr is the training record in
[ net, tr, Y, E] = train( net, P, T );
Is this any help?
Greg
Walter Roberson
on 14 Feb 2020
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
on 18 Jun 2020
Can you please provide information, how to solve this problem with new version of MATLAB??
Walter Roberson
on 18 Jun 2020
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
on 24 Jan 2021
Can you please provide the detailed information to solve this problem ? I met the same prolem with yours ,recently.
Walter Roberson
on 24 Jan 2021
tr = nnetTrainingRecord(net);
tr.perf(1) = sumsqr(t);
tr.perf(2) = sse;
浩 陈
on 8 Jun 2022
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
on 8 Jun 2022
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
Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!