Back propagation to learn invariance