Perceptron on PBASIC
-
Goal is to write the perceptron activity into a computer program using PBASIC
language and the basic stamp processor.
Attempt 1:
-
Represented all A items as one array and all B items as another array
-
Stored x and y coordinates of each item in the highbyte and low byte slots.
-
Discovered that array items couldn't be modified, so aliases were assigned to each
array item
-
Then discovered that highbyte of item and lowbyte of item cannot be used to store
negative numbers because negative numbers must be stored in a word sized variable.
A highbyte/lowbyte of a word sized variable is byte sized.
-
The PBASIC language is bad with non-integer and negative numbers because the
non-integer and negative numbers rarely come up when dealing with input/output
signals, resistance, frequency etc. (Primary things PBASIC is supposed to deal
with when controlling robot processors
Attempt 2:
-
Tried shifting all data poitns and vectors to positive integers
-
Realized weight vectors cannot be always positive
-
Then discovered that the weight vectors don't need to be always positive, only
the input patterns do.
-
Ran out of memory space on the processor, so converted the input patterns to
byte sized variables
-
Represented A data with one array nda B data with another array, one set of x and
y components for one data point will be represented by A(index), A(index+1)
and B(index), B(index+1)
-
Subroutines significantly shortens the code of the program