Implemented for perceptron