Main Content

sse

Sum squared error performance function

Description

example

perf= sse(net,t,y,ew)takes a networknet, targetsT, outputsY, and optionally error weightsEW, and returns network performance calculated as the sum squared error.

sseis a network performance function. It measures performance according to the sum of squared errors.

perf= sse(net,t,y,ew,Name,Value)has two optional function parameters that set the regularization of the errors and the normalizations of the outputs and targets.

sseis a network performance function. It measures performance according to the sum of squared errors.

Examples

collapse all

This example shows how to calculate the performance of a feed-forward network with thessefunction.

Create a network using the data from the simple fit data set, train it, and calculate its performance.

[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)

Input Arguments

collapse all

Input network, specified as a network object. To create a network object, use for example,feedforwardnetornarxnet.

Network targets, specified as a matrix or cell array.

Network outputs, specified as a matrix or cell array.

Error weights, specified as a vector, matrix, or cell array.

Error weights can be defined by sample, output element, time step, or network output:

ew = [1.0 0.5 0.7 0.2]; % Across 4 samples ew = [0.1; 0.5; 1.0]; % Across 3 elements ew = {0.1 0.2 0.3 0.5 1.0}; % Across 5 timesteps ew = {1.0; 0.5}; % Across 2 outputs

The error weights can also be defined across any combination, such as across two time-series (i.e., two samples) over four timesteps.

ew = {[0.5 0.4],[0.3 0.5],[1.0 1.0],[0.7 0.5]};

在一般情况下,我们的错误ights may have exactly the same dimensions as targets, in which case each target value will have an associated error weight.

The default error weight treats all errors the same.

ew = {1}

Name-Value Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

Example:'regularization',0.1

Proportion of performance attributed to weight and bias values, specified as the comma-separated pair consisting of'regularization'and an integer between0and1. The larger this value is, the more the network is penalized for larger weights, and the more likely the network function avoids overfitting.

Output and target normalization, specified as the comma-separated pair consisting of'normalization'and either:

  • 'none'— performs no normalization.

  • 'standard'— normalizes outputs and targets to[-1, +1], and therefore normalizes errors to[-2, +2].

  • 'percent'— normalizes outputs and targets to[-0.5, +0.5], and therefore normalizes errors to[-1, +1].

Output Arguments

collapse all

Network performance calculated as the sum squared error, returned as a scalar.

More About

collapse all

Network Use

To prepare a custom network to be trained withsse, setnet.performFcnto'sse'. This automatically setsnet.performParamto the default function parameters.

Then callingtrain,adaptorperformwill result inssebeing used to calculate performance.

See Also

|

Introduced before R2006a