Partial implementation of the perceptron algorithm.