Invariance and Invertibility in Deep Neural Networks