next up previous contents index
Next: MainLoop.m and MainNNToolbox.m Up: Base Modules Previous: LoadIO.m

RndWtsBs.m

 Module to initialize connections between layers, i.e weight and bias values. Also normalizes weight values.

First the random number generator seed is initialized to the variable randomseed  if it's defined, and to an nondeterministic number (current time of day) otherwise. Then all weight and bias values are randomized within \( \pm \)weightLim using the function rand  (see Section 5).

Additionally, the arrays msErr  and allstopper , containing the mean squared error and criterion values accumulated during training respectively, are initialized to empty arrays here.

The weights and biases are then optionally normalized. For this purpose the weight values are divided by the fan-in of the units that they are targeting. For the hidden layer units, the fan-in would be numInputs , and for the output layer, would be numHids  [Hassoun95, p. 242].

Variables holding the weight and bias values are defined as matrices and are listed here as follows (see [Hagan96, pp. 2-3 to 2-13 ] for an introduction of matrix representation of networks):

wtsL1 
Weight matrix of size numHids\( \times \)numInputs connecting inputs to the hidden layer.
wtsL2 
Weight matrix of size numOuts\( \times \)numHids connecting the hidden layer to the output layer.
biasWtsL1 
Bias matrix of size numHids connected to the hidden layer.
biasWtsL2 
Bias matrix of size numOuts connected to the output layer.


next up previous contents index
Next: MainLoop.m and MainNNToolbox.m Up: Base Modules Previous: LoadIO.m
Cengiz Gunay
2000-06-25