One perceptron step is exact integer arithmetic. This lesson writes the update rule and checks the first pass through the fixed order.

highlighted = computed this step

The update rule

For a row with label y, compute a=w*x+b. If y*a<=0, update w<-w+y*x and b<-b+y.

ya0ww+yx, bb+yy a\le 0\Rightarrow w\leftarrow w+yx,\ b\leftarrow b+y
First passThe first pass shows exact integer updates.First pass through the orderrule: y*a <= 0 updatestixyold w,bay*aupdnew w,b00(1,0)+1(0,0),000yes(1,0),1shown update ends w=(1,0), b=1

Why the first update fires

Start at w=(0,0), b=0. Row 0 has activation 0, so y*a=0 and the update gives w=(1,0), b=1.

(1)0=0w=(1,0),b=1(1)\cdot 0=0\Rightarrow w=(1,0), b=1
First passThe first pass shows exact integer updates.First pass through the orderrule: y*a <= 0 updatestixyold w,bay*aupdnew w,b00(1,0)+1(0,0),000yes(1,0),1shown update ends w=(1,0), b=1

Summary

The arithmetic is integer addition. A changed activation, update flag, or new state is rejected by the run-table validator.

exact integer update\text{exact integer update}
First passThe first pass shows exact integer updates.First pass through the orderrule: y*a <= 0 updatestixyold w,bay*aupdnew w,b00(1,0)+1(0,0),000yes(1,0),1shown update ends w=(1,0), b=1