| Neural Network Toolbox | |
| Provide feedback about this page |
Mean squared error with regularization and economization performance function
Syntax
perf = mseregec(E,Y,X,FP) dPerf_dy = mseregec('dy',E,Y,X,perf,FP); dPerf_dx = mseregec('dx',E,Y,X,perf,FP); info = mseregec(code)
Description
mseregec is a network performance function. It measures network performance as the weighted sum of three factors: the mean squared error, the mean squared weights and biases, and the mean squared output.
mseregec(E,Y,X,PP) takes these arguments,
and returns the mean squared error, plus FP.reg times the mean squared weights, plus FP.econ times the mean squared output.
mseregec('dy',E,Y,X,perf,FP) returns the derivative of perf with respect to Y.
mseregec('dx',E,Y,X,perf,FP) returns derivative of perf with respect to X.
mseregec('name') returns the name of this function.
mseregec('pnames') returns the name of this function.
mseregec('pdefaults') returns the default function parameters.
Examples
Here a two-layer feed-forward network is created with a one-element input ranging from -2 to 2, four hidden tansig neurons, and one purelin output neuron.
The network is given a batch of inputs P. The error is calculated by subtracting the output A from target T. Then the mean squared error is calculated using a ratio of 20/(20+1). (Errors are 20 times as important as weight and bias values.)
p = [-2 -1 0 1 2]; t = [0 1 1 1 0]; y = sim(net,p) e = t-y net.performParam.ratio = 20/(20+1); perf = mseregec(e,net)
Network Use
You can create a standard network that uses mseregec with newff, newcf, or newelm.
To prepare a custom network to be trained with mseregec, set net.performFcn to 'mseregec'. This automatically sets net.performParam to mseregec's default performance parameters.
In either case, calling train or adapt results in mseregec's being used to calculate performance.
See newff or newcf for examples.
See Also
| Provide feedback about this page |
![]() | msereg | nctool | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |