How can I pass the performance parameters to my own custom performance function in the Neural Network Toolbox?

3 vues (au cours des 30 derniers jours)
How can I pass the performance parameters to my own custom performance function in the Neural Network Toolbox?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 18 Oct 2013
For releases of MATLAB prior to MATLAB 8.0 (R2012b), the MSEREG function within the Neural Network Toolbox is a good example of a performance function using the performance parameters.
1) The custom performance function should have a header that looks like:
function perf= myperfFcn(e, x, pp)
where:
E - Matrix or cell array of error vector(s).
X - Vector of all weight and bias values.
PP - Performance parameter structure.
2) To specify your custom performance function:
net.performFcn = 'myperfFcn'
3) To specify your custom performance parameters:
perfStruct.varA = 1;
perfStruct.varB = 2;
net.performParam = perfStruct;
Note the "net" structure will now include:
    parameters:
         adaptParam: .passes
         initParam: (none)
         performParam: .varA, .varB
For releases of MATLAB starting in MATLAB 8.0 (R2012b), information is provided by the command,
>> help nncustom
For example, to specify a custom performance function, execute the command,
>> which mse
to locate the 'mse' function.  Copy and rename the file 'mse.m' and the folder '+mse'.  Then, use these functions as templates to write your own custom function.

Plus de réponses (0)

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by