A generative model of galactic dust emission using variational autoencoders