An elegant way to represent forward propagation and back propagation in a neural network