# sae

Sum absolute error performance function

## Syntax

`perf = sae(net,t,y,ew)[...] = sae(...,'regularization',regularization)[...] = sae(...,'normalization',normalization)[...] = sae(...,'squaredWeighting',squaredWeighting)[...] = sae(...,FP)`

## Description

`sae` is a network performance function. It measures performance according to the sum of squared errors.

`perf = sae(net,t,y,ew)` takes these input arguments and optional function parameters,

 `net` Neural network `t` Matrix or cell array of target vectors `y` Matrix or cell array of output vectors `ew` Error weights (default = `{1}`)

and returns the sum squared error.

This function has three optional function parameters that can be defined with parameter name/pair arguments, or as a structure `FP` argument with fields having the parameter name and assigned the parameter values:

`[...] = sae(...,'regularization',regularization)`

`[...] = sae(...,'normalization',normalization)`

`[...] = sae(...,'squaredWeighting',squaredWeighting)`

`[...] = sae(...,FP)`

• `regularization` — can be set to any value between the default of 0 and 1. The greater the regularization value, the more squared weights and biases are taken into account in the performance calculation.

• `normalization` — can be set to the default `'absolute'`, or `'normalized'` (which normalizes errors to the `[+2 -2]` range consistent with normalized output and target ranges of `[-1 1]`) or `'percent'` (which normalizes errors to the range ```[-1 +1]```).

• `squaredWeighting` — can be set to the default false, for applying error weights to absolute errors, or false for applying error weights to the squared errors before squaring.

## Examples

Here a network is trained to fit a simple data set and its performance calculated

```[x,t] = simplefit_dataset; net = fitnet(10,'trainscg'); net.performFcn = 'sae'; net = train(net,x,t) y = net(x) e = t-y perf = sae(net,t,y) ```

## Network Use

To prepare a custom network to be trained with `sae`, set `net.performFcn` to `'sae'`. This automatically sets `net.performParam` to the default function parameters.

Then calling `train`, `adapt` or `perform` will result in `sae` being used to calculate performance.

Was this topic helpful?

Get trial now