Replaced floats with doubles for better accuracy without speed loss
Optimised perceptron parameters