neural network implementation written in python