Update perceptron algorithm