Encoding Invariances in Deep Generative Models