Invariant Representations without Adversarial Training