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.One exact perceptron updateone static update: state -> score -> rule -> next state#stagederived display1currentcurrent state: w=(0,0), b=02rowrow 0: x=(1,0), y=+13scorea=w*x+b=0; y*a=04decision0 <= 0 so update5nextnext state: w=(1,0), b=1update fires under y*a <= 0First 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.One exact perceptron updateone static update: state -> score -> rule -> next state#stagederived display1currentcurrent state: w=(0,0), b=02rowrow 0: x=(1,0), y=+13scorea=w*x+b=0; y*a=04decision0 <= 0 so update5nextnext state: w=(1,0), b=1update fires under y*a <= 0First 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.One exact perceptron updateone static update: state -> score -> rule -> next state#stagederived display1currentcurrent state: w=(0,0), b=02rowrow 0: x=(1,0), y=+13scorea=w*x+b=0; y*a=04decision0 <= 0 so update5nextnext state: w=(1,0), b=1update fires under y*a <= 0First 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