Domain Generalization And Adaptation With Generative Modeling And Representation Learning