Perceptron Implementation for IA course