Variational autoencoders (VAE) [1]} is a framework to model the data generation process via approximation of joint probability \(p(x,z)\)  over observed variables \(x\)  and latent variables \(z\) . It combines a generative model \(p_\theta (x|z)\) , an inference model \(q_\phi (z|x)\)  and a prior \(p(z)\) , allowing unconditional data generation from a learned distribution model. Conditional VAEs (CVAEs) [2]} is an extension of the framework that models a conditional distribution \(p(x,z|y)\) . To learn the model parameters \(\theta \) , \(\phi \) , one maximizes the conditional log-likelihood \(log \: p_\theta (x|y)\)  via maximizing the evidence lower bound [1]}, [2]}. Subsequently, one can sample from conditional distribution \(p_\theta (x|y,z)\)  where random noise \(z\)  attributes for the variance in reconstruction of \(x\)  from \(y\) . We model each distribution as Normal distribution with learnable mean and variance.
