Principles and Applications of Discrete Deep Generative Models