Neural Network Toolbox | Search  Help Desk |
msereg | Examples See Also |
Mean squared error w/reg performance function
perf = mse(e,x,pp)
perf = mse(e,net,pp)
info = mse(code)
msereg
is a network performance function. It measures network performance as the weight sum of two factors: the mean squared error and the mean squared weight and bias values.
msereg(E,X,PP)
takes from three arguments,
E -
Matrix or cell array of error vector(s).
X -
Vector of all weight and bias values.
PP -
Performance parameter.
PP
defines one performance parameters,
PP.ratio -
Relative importance of errors vs. weight and bias values.
PP.ratio
) with the mean squared weight and bias values (times 1-PP.ratio
).
The errors E
can be given in cell array form,
E - Nt
x TS
cell array, each element E{i,ts}
is an Vi
x Q
matrix or []
.
E -
(sum of Vi
) x Q
matrix
mse(E,net)
takes an alternate argument to X
and PP
,
net -
Neural network from which X
and PP
can be obtained.
mse(code)
returns useful information for each code
string:
'deriv
'
- Name of derivative function.
'pnames
'
- Names of training parameters.
'pdefaults
'
- Default training parameters.
net = newff([-2 2],[4 1] {'tansig','purelin'},'trainlm','learngdm','msereg');Here 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 = msereg(e,net)You can create a standard network that uses
msereg
with newff
, newcf
, or newelm
.
To prepare a custom network to be trained with msereg,
set net.performFcn
to 'msereg
'. This will automatically set net.performParam
to msereg
's default performance parameters.
In either case, calling train
or adapt
will result in msereg
being used to calculate performance.
See newff
or newcf
for examples.
mse
,
mae
,
dmsereg