Neural Network Toolbox Previous page   Next Page

Initialization (init)

You can use the function init to reset the network weights and biases to their original values. Suppose, for instance that you start with the network

Now check its weights with

which gives, as expected,

In the same way, you can verify that the bias is 0 with

which gives

Now set the weights to the values 3 and 4 and the bias to the value 5 with

Recheck the weights and bias as shown above to verify that the change has been made. Sure enough,

Now use init to reset the weights and bias to their original values.

We can check as shown above to verify that

We can change the way that a perceptron is initialized with init. For instance, we can redefine the network input weights and bias initFcns as rands, and then apply init as shown below.

Now check on the weights and bias.

We can see that the weights and bias have been given random numbers.

You may want to read more about init in Advanced Topics.


Previous page  Simulation (sim) Learning Rules Next page

© 1994-2005 The MathWorks, Inc.