add perceptron training method