Changing avg-perceptron to one-dimensional