A Deep Generative Approach to Stratified Learning