Main Content

adaptwb

Adapt network with weight and bias learning rules

Syntax

[net,ar,Ac] = adapt(net,Pd,T,Ai)

Description

This function is normally not called directly, but instead called indirectly through the function adapt after setting a network’s adaption function (net.adaptFcn) to this function.

[net,ar,Ac] = adapt(net,Pd,T,Ai) takes these arguments,

net

Neural network

Pd

Delayed processed input states and inputs

T

Targets

Ai

Initial layer delay states

and returns

net

Neural network after adaption

ar

Adaption record

Ac

Combined initial layer states and layer outputs

Examples

Linear layers use this adaption function. Here a linear layer with input delays of 0 and 1, and a learning rate of 0.5, is created and adapted to produce some target data t when given some input data x. The response is then plotted, showing the network’s error going down over time.

x = {-1  0 1 0 1 1 -1  0 -1 1 0 1};
t = {-1 -1 1 1 1 2  0 -1 -1 0 1 1};
net = linearlayer([0 1],0.5);
net.adaptFcn
[net,y,e,xf] = adapt(net,x,t);
plotresponse(t,y)

Version History

Introduced in R2010b

See Also