fix supervised perceptron bugs