NeuralNet algorithm done in python