Contenuto principale

defaultderiv

Default derivative function

Syntax

defaultderiv('dperf_dwb',net,X,T,Xi,Ai,EW)
defaultderiv('de_dwb',net,X,T,Xi,Ai,EW)

Description

This function chooses the recommended derivative algorithm for the type of network whose derivatives are being calculated. For static networks, defaultderiv calls staticderiv; for dynamic networks it calls bttderiv to calculate the gradient and fpderiv to calculate the Jacobian.

defaultderiv('dperf_dwb',net,X,T,Xi,Ai,EW) takes these arguments,

net

Neural network

X

Inputs, an R-by-Q matrix (or N-by-TS cell array of Ri-by-Q matrices)

T

Targets, an S-by-Q matrix (or M-by-TS cell array of Si-by-Q matrices)

Xi

Initial input delay states (optional)

Ai

Initial layer delay states (optional)

EW

Error weights (optional)

and returns the gradient of performance with respect to the network’s weights and biases, where R and S are the number of input and output elements and Q is the number of samples (or N and M are the number of input and output signals, Ri and Si are the number of each input and outputs elements, and TS is the number of timesteps).

defaultderiv('de_dwb',net,X,T,Xi,Ai,EW) returns the Jacobian of errors with respect to the network’s weights and biases.

Examples

Here a feedforward network is trained and both the gradient and Jacobian are calculated.

[x,t] = simplefit_dataset;
net = feedforwardnet(10);
net = train(net,x,t);
y = net(x);
perf = perform(net,t,y);
dwb = defaultderiv('dperf_dwb',net,x,t)

Version History

Introduced in R2010b