The recipie in the home cell (steps a through g) works for large values of k, but it requires you to repeatedly select the first calc list, evaluate, select the second calc list, evaluate, and so on. We can get around this inconvenience by changing the output vector component formulae, (bj's) to:
2) bj=a1*w1j!+a2*w2j!+a3*w3j!+a4*w4j! j=1..4
The exclamation points cause the weights to be recalculated first (propagate override on evaluation rule) before the previous values of the aj's are substituted into the formulae.
With this change it is possible to to teach the pattern asociation in one iterative calculation. Set the iterations to 10 or 20, or whatever it takes, and execute the calc list:
b1,b2,b3,b4
</text></cell>
<cell>
<cname>b1</cname>
<val>10.02</val>
<form>a1*w11+a2*w21+a3*w31+a4*w41</form></cell>
<cell>
<cname>b2</cname>
<val>0.00</val>
<form>a1*w12+a2*w22+a3*w32+a4*w42</form></cell>
<cell>
<cname>b3</cname>
<val>-10.02</val>
<form>a1*w13+a2*w23+a3*w33+a4*w43</form></cell>
<cell>
<cname>b4</cname>
<val>0.00</val>
<form>a1*w14+a2*w24+a3*w34+a4*w44</form></cell>
<cell>
<cname>home</cname>
<text>This web illustrates Hebbian learning and the use of a delta rule for pattern association between two four element vectors A and B, using an interconnection matrix W.
a1 a2 a3 a4
w11 w12 w13 w15 b1
w21 w22 w23 w24 b2
w31 w32 w33 w34 b3
w41 w42 w43 w44 b4
For any collection of weights (wij's) and inputs (aj's), a collection of outputs (bj's) may be computed according to the formula:
1) bj=a1*w1j+a2*w2j+a3*w3j+a4*w4j, j=1..4
For a given input vector A, it is possible to 'teach' the associator to produce a particular output vector, (the target vectorT ) in the following way:
a) Set the values aj of the input vector A
b) Set the values ti of the target vector T
c) Set the values of the weights wij to random or
the similar small values.
d) Set the formulae of the weights to the expression:
wij=wij+ai*(tj-bj)/k ( delta rule)
e) Compute a trial set of output values using equation 1). The formulae in bj will accomplish this task if you set the Calc preference "Recalc All Cells?" to No, and select and evaluate the cell name list:
b1,b2,b3,b4
f) Then recompute the weights wij by selecting and evaluating the list:
w11,w12,w13,w14,w21,w22,w23,w24,w31,w32,w33,
w34,w41,w42,w43,w44
g) Repet steps e) and f) until the output vector B is as close to the target vector T as you desire.
For a way to accomplish this in one step, go to the cell called &A_Faster_Way</text></cell>