Stand-alone perceptron implementation