Simple perceptron model in python