Back Propagation Implementation in Python