Neural Network Toolbox |
Training
Next we need to train the network to obtain first-layer weights that lead to the correct classification of input vectors. We do this with train
as shown below. First set the training epochs to 150. Then, use train
.
Now check on the first-layer weights.
The following plot shows that these weights have moved toward their respective classification groups.
To check to see that these weights do indeed lead to the correct classification, take the matrix P
as input and simulate the network. Then see what classifications are produced by the network.
which is what we expected. As a last check, try an input close to a vector that was used in training.
This looks right, for pchk1 is close to other vectors classified as 2. Similarly,
This looks right too, for pchk2 is close to other vectors classified as 1.
You might want to try the demonstration program demolvq1
. It follows the discussion of training given above.
LVQ1 Learning Rule (learnlv1) | Supplemental LVQ2.1 Learning Rule (learnlv2) |
© 1994-2005 The MathWorks, Inc.