fix of perceptron code