|
The Backpropagation Network, or BPN, is a feed-forward, layered network. Each
node in a layer is connected to all other nodes in the layer before it and the layer
after it. It is especially useful for modeling multivariate functions.
Note: NeurOn-Line does not use G2 objects to represent the nodes and connections in a BPN. Instead, NeurOn-Line stores the network internally and lets
you change the network's architecture with the configure menu choice.
Before you can pass data through a network, you must train the network. For
more information, see "Training Blocks"." The number of data pairs in the
training data set should be greater than the number of weights over the number of
outputs. For example, if a network has 5 inputs, 10 hidden nodes and 3 outputs,
its training data set should have at least this many data pairs.
In practice, several times this number is recommended.
Configuring
To set the number of layers, number of nodes, and the transfer functions, you
configure the BPN block.
configure on the block, NeurOn-Line displays this dialog:
|
To set the number of layers, use the arrows to the right of the Number of Layers
attribute. To increase the number, click the up arrow. To decrease the number,
click the down arrow. You can select 2 to 5 layers.
linear or sigmoid
button for the Transfer Function attribute for each layer. Selecting the button
toggles the button between linear and sigmoid.
Caution: If you change the architecture for a trained network by reducing the size of
any layer, you must retrain the network.
Adjusting Weights
When you first clone a BPN off the palette, all its weights are set to zero. However,
the network needs to contain small random weights to train properly. To fill the
network with weights appropriate for training, select the randomize weights. . .
button. NeurOn-Line overwrites the block`s current weights with new random
weights.
Caution: When you click the Randomize Weights button, NeurOn-Line immediately
commits your changes. Clicking the Cancel button does not discard them.
NeurOn-Line displays the dialog below, which lets you specify an absolute
amount to randomize by, a percentage to randomize by, or both:
|
This is the formula that the block uses to jiggle the weights, where
P is the
percentage you entered, A is the absolute amount you entered, and R1 and R2 are
random numbers from -1.0 to 1.0.
Saving and Loading Weights
You can save the network's weights to a text file so you can load them later. The
file format for saved weights is described in "Saving and Loading Network
Weights".
To save or load network data, select the
file operations. . . menu choice to display
this dialog:
|
Edit the File Pathname attribute to specify the filename. To save the weights,
select the Save to File button. To load weights, overwriting the weights that are
currently in the network, select the Load from File button.
Making Values Permanent
When you choose make permanent from the block's menu, it saves the network's
internal configuration and weight so that resetting G2 has no effect on their
values.
Examples
The following configure dialog is for a BPN that is being trained with a data set of
angles and their sines. It contains three layers: the input layer, the output layer,
and one hidden layer. Both the input and output layers have 1 node and use the
linear function. The hidden layer has 4 nodes and uses the sigmoid function.
|
Below is a simple diagram for training a network. The data set on the left is filled
with a sample of angles and their sines. The BPN is configured as described
above. To train this network, choose
configure from the BPN's menu and click
Randomize Weights, then choose evaluate from the Training block's menu.
|
This diagram uses a trained BPN to estimate the sine for an angle of 45 degrees.
|
See Also
For more information on how to use this block, see the pages below.
| Click here for more information... |
|---|
|
Basic Block Behavior
|
|
Saving a Block's Data After Resetting G2
|
| Prev
| Next | Start of Chapter | End of Chapter | Contents | Index | (3 out of 6)
Copyright © 1996, Gensym Corporation, Inc.