Mean absolute error performance function
info = mae('code') returns useful information for each
code character vector:
mae('name') returns the name of this function.
mae('pnames') returns the names of the training
mae('pdefaults') returns the default function
This example shows how to calculate the network performance as the mean of absolute errors.
Create and configure a perceptron to have one input and one neuron:
net = perceptron; net = configure(net,0,0);
The network is given a batch of inputs
P. The error is calculated
by subtracting the output
A from target
the mean absolute error is calculated.
p = [-10 -5 0 5 10]; t = [0 0 1 1 1]; y = net(p) e = t-y perf = mae(e)
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.
Errors, specified as a vector, a matrix, or a cell array.
Network outputs, specified as a vector, a matrix, or a cell array.
X— Weight and bias
Weight and bias values, specified as a vector.
perf— Network performance
Network performance as the mean of absolute errors, returned as a scalar.
dPerf_dx— Derivative of network performance
perf with respect to
as a scalar.
You can create a standard network that uses
To prepare a custom network to be trained with
'mae'. This automatically sets
net.performParam to the empty matrix
mae has no performance parameters.
In either case, calling
adapt, results in
mae being used to calculate performance.