Neural Network Toolbox | ![]() ![]() |
Mean absolute error performance function
Syntax
Description
mae
is a network performance function.
mae(E,X,PP)
takes from one to three arguments,
E -
Matrix or cell array of error vector(s).
X -
Vector of all weight and bias values (ignored).
PP -
Performance parameters (ignored).
and returns the mean absolute error.
The errors E
can be given in cell array form,
E - Nt
x TS
cell array, each element E{i,ts}
is a Vi x Q
matrix or[]
.
E - (sum of Vi)
x Q
matrix
mae(E,net,PP)
can take an alternate argument to X
,
net
- Neural network from which X
can be obtained (ignored).
mae(code)
returns useful information for each code
string:
deriv
' -
Name of derivative function.
'name
' -
Full name.
'pnames
' -
Names of training parameters.
'pdefaults
' - Default training parameters.
Examples
Here a perceptron is created with a 1-element input ranging from -10 to 10, and one neuron.
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 absolute error is calculated.
Note that mae
can be called with only one argument because the other arguments are ignored. mae
supports those arguments to conform to the standard performance function argument list.
Network Use
You can create a standard network that uses mae
with newp
.
To prepare a custom network to be trained with mae, set net.performFcn
to 'mae
'. This will automatically set net.performParam
to the empty matrix []
, as mae
has no performance parameters.
In either case, calling train
or adapt
will result in mae
being used to calculate performance.
See newp
for examples.
See Also
![]() | logsig | mandist | ![]() |