Back propagation network written in python