Learning Invariancesin Neural Networks