C++ Neural Networks and Fuzzy Logic
by Valluru B. Rao M&T Books, IDG Books Worldwide, Inc. ISBN: 1558515526 Pub Date: 06/01/95 |
Previous | Table of Contents | Next |
The output from an illustrative run of the program is listed next. You will notice that we provided for a lot of information to be output as the program is executed. The fourth vector we input is not from an exemplar, but it is the complement of the X of the first exemplar pair. The network found the complement of the Y of this exemplar to be associated with this input. The fifth vector we input is (1, 1, 1, 1, 1, 1). But BAM recalled in this case the complement pair for the third exemplar pair, which is X = (1, 0, 0, 1, 1, 1) and Y = (0, 1, 1, 0, 1). You notice that the Hamming distance of this input pattern from the Xs of the three exemplars are 3, 3, and 4, respectively. The hamming distance from the complement of the X of the first exemplar pair is also 3. But the Hamming distance of (1, 1, 1, 1) from the X of the complement of the X of the third exemplar pair is only 2. It would be instructive if you would use the input pattern (1, 1, 1, 1, 1, 0) to see to what associated pair it leads. Now the output:
THIS PROGRAM IS FOR A BIDIRECTIONAL ASSOCIATIVE MEMORY NETWORK. THE NETWORK IS SET UP FOR ILLUSTRATION WITH SIX INPUT NEURONS AND FIVE OUTPUT NEURONS. Three exemplars are used to encode X vector you gave is: 1 0 1 0 1 0 Y vector you gave is: 1 1 0 0 1 bipolar version of X vector you gave is: 1 -1 1 -1 1 -1 bipolar version of Y vector you gave is: 1 1 -1 -1 1 X vector you gave is: 1 1 1 0 0 0 Y vector you gave is: 0 1 0 1 1 bipolar version of X vector you gave is: 1 1 1 -1 -1 -1 bipolar version of Y vector you gave is: -1 1 -1 1 1 X vector you gave is: 0 1 1 0 0 0 Y vector you gave is: 1 0 0 1 0 bipolar version of X vector you gave is: -1 1 1 -1 -1 -1 bipolar version of Y vector you gave is: 1 -1 -1 1 -1 weights input layer to output layer: -1 3 -1 -1 3 -1 1 -1 3 -1 1 1 -3 1 1 -1 -1 3 -1 -1 1 1 1 -3 1 -1 -1 3 -1 -1 weights output layer to input layer: -1 -1 1 -1 1 -1 3 -1 1 -1 1 -1 -1 -1 -3 3 1 3 -1 3 1 -1 -3 -1 3 -1 1 -1 1 -1 Input vector is: 1 0 1 0 1 0 output layer neuron 0 activation is 1 output layer neuron 0 output is 1 output layer neuron 1 activation is 5 output layer neuron 1 output is 1 output layer neuron 2 activation is -3 output layer neuron 2 output is 0 output layer neuron 3 activation is -3 output layer neuron 3 output is 0 output layer neuron 4 activation is 5 output layer neuron 4 output is 1 X vector in possible associated pair is: 1 0 1 0 1 0 Y vector in possible associated pair is: 1 1 0 0 1 input layer neuron 0 activation is 5 input layer neuron 0 output is 1 input layer neuron 1 activation is -3 input layer neuron 1 output is 0 input layer neuron 2 activation is 3 input layer neuron 2 output is 1 input layer neuron 3 activation is -3 input layer neuron 3 output is 0 input layer neuron 4 activation is 3 input layer neuron 4 output is 1 input layer neuron 5 activation is -3 input layer neuron 5 output is 0 output layer neuron 0 activation is 1 output layer neuron 0 output is 1 output layer neuron 1 activation is 5 output layer neuron 1 output is 1 output layer neuron 2 activation is -3 output layer neuron 2 output is 0 output layer neuron 3 activation is -3 output layer neuron 3 output is 0 output layer neuron 4 activation is 5 output layer neuron 4 output is 1 X vector in possible associated pair is: 1 0 1 0 1 0 Y vector in possible associated pair is: 1 1 0 0 1 PATTERNS ASSOCIATED: X vector in the associated pair no. 1 is: 1 0 1 0 1 0 Y vector in the associated pair no. 1 is: 1 1 0 0 1 Input vector is: 1 1 1 0 0 0 // We get here more of the detailed output as in the previous case. We will simply not present it here. PATTERNS ASSOCIATED: X vector in the associated pair no. 1 is: 1 1 1 0 0 0 Y vector in the associated pair no. 1 is: 0 1 0 1 1 Input vector is: 0 1 1 0 0 0 output layer neuron 0 activation is 0 A 0 is obtained, use previous output value output layer neuron 0 output is 1 output layer neuron 1 activation is 0 A 0 is obtained, use previous output value output layer neuron 1 output is 0 output layer neuron 2 activation is -4 output layer neuron 2 output is 0 output layer neuron 3 activation is 4 output layer neuron 3 output is 1 output layer neuron 4 activation is 0 A 0 is obtained, use previous output value output layer neuron 4 output is 0 X vector in possible associated pair is: 0 1 1 0 0 0 Y vector in possible associated pair is: 1 0 0 1 0 // We get here more of the detailed output as in the previous case. We will simply not present it here. PATTERNS ASSOCIATED: X vector in the associated pair no. 1 is: 0 1 1 0 0 0 Y vector in the associated pair no. 1 is: 1 0 0 1 0 Input vector is: 0 1 0 1 0 1 // We get here more of the detailed output as in the previous case. We will simply not present it here. X vector in possible associated pair is: 0 1 0 1 0 1 Y vector in possible associated pair is: 0 0 1 1 0 // We get here more of the detailed output as in the previous case. We will simply not present it here. X vector in possible associated pair is: 0 1 0 1 0 1 Y vector in possible associated pair is: 0 0 1 1 0 PATTERNS ASSOCIATED: X vector in the associated pair no. 1 is: 0 1 0 1 0 1 Y vector in the associated pair no. 1 is: 0 0 1 1 0 Input vector is: 1 1 1 1 1 1 output layer neuron 0 activation is -2 output layer neuron 0 output is 0 output layer neuron 1 activation is 2 output layer neuron 1 output is 1 output layer neuron 2 activation is 2 output layer neuron 2 output is 1 output layer neuron 3 activation is -2 output layer neuron 3 output is 0 output layer neuron 4 activation is 2 output layer neuron 4 output is 1 X vector in possible associated pair is: 1 1 1 1 1 1 Y vector in possible associated pair is: 0 1 1 0 1 input layer neuron 0 activation is 5 input layer neuron 0 output is 1 input layer neuron 1 activation is -3 input layer neuron 1 output is 0 input layer neuron 2 activation is -1 input layer neuron 2 output is 0 input layer neuron 3 activation is 1 input layer neuron 3 output is 1 input layer neuron 4 activation is 3 input layer neuron 4 output is 1 input layer neuron 5 activation is 1 input layer neuron 5 output is 1 output layer neuron 0 activation is -2 output layer neuron 0 output is 0 output layer neuron 1 activation is 2 output layer neuron 1 output is 1 output layer neuron 2 activation is 6 output layer neuron 2 output is 1 output layer neuron 3 activation is -6 output layer neuron 3 output is 0 output layer neuron 4 activation is 2 output layer neuron 4 output is 1 X vector in possible associated pair is: 1 0 0 1 1 1 Y vector in possible associated pair is: 0 1 1 0 1 PATTERNS ASSOCIATED: X vector in the associated pair no. 1 is: 1 0 0 1 1 1 Y vector in the associated pair no. 1 is: 0 1 1 0 1 THE FOLLOWING ASSOCIATED PAIRS WERE FOUND BY BAM X vector in the associated pair no. 1 is: //first exemplar pair 1 0 1 0 1 0 Y vector in the associated pair no. 1 is: 1 1 0 0 1 X vector in the associated pair no. 2 is: //second exemplar pair 1 1 1 0 0 0 Y vector in the associated pair no. 2 is: 0 1 0 1 1 X vector in the associated pair no. 3 is: //third exemplar pair 0 1 1 0 0 0 Y vector in the associated pair no. 3 is: 1 0 0 1 0 X vector in the associated pair no. 4 is: //complement of X of the 0 1 0 1 0 1 first exemplar pair Y vector in the associated pair no. 4 is: //complement of Y of the 0 0 1 1 0 first exemplar pair X vector in the associated pair no. 5 is: //input was X = (1, 1, 1, 1 0 0 1 1 1 1, 1) but result was complement of third exemplar pair Y vector in the associated pair no. 5 is: with X of which Hamming 0 1 1 0 1 distance is the least.
Previous | Table of Contents | Next |