Diffusion Model As Representation Learner