# sse

Sum squared error performance function

## Syntax

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

## Description

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

`perf = sse(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 which 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.

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

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

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

`[...] = sse(...,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 `true`, for applying error weights to squared errors; or `false` for applying error weights to the absolute 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); net.performFcn = 'sse'; net = train(net,x,t) y = net(x) e = t-y perf = sse(net,t,y) ```

## Network Use

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

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