Neural Network Toolbox Previous page   Next Page

Network Behavior

Initialization

Initialize your network with the following line of code.

Reference the network's biases and weights again to see how they have changed.

For example,

Training

Define the following cell array of two input vectors (one with two elements, one with five) for two time steps (i.e., two columns).

We want the network to respond with the following target sequence.

Before training, we can simulate the network to see whether the initial network's response Y is close to the target T.

The second row of the cell array Y is the output sequence of the second network output, which is also the output sequence of the third layer. The values you got for the second row may differ from those shown due to different initial weights and biases. However, they will almost certainly not be equal to our targets T, which is also true of the values shown.

The next task is to prepare the training parameters. The following line of code displays the default Levenberg-Marquardt training parameters (which were defined when we set net.trainFcn to trainlm).

The following properties should be displayed.

Change the performance goal to 1e-10.

Next, train the network with the following call.

Below is a typical training plot.

After training you can simulate the network to see if it has learned to respond correctly.

Note that the second network output (i.e., the second row of the cell array Y), which is also the third layer's output, does match the target sequence T.


Previous page  Network Definition Additional Toolbox Functions Next page

© 1994-2005 The MathWorks, Inc.