Back to Annotated Deep Learning Paper Implementations

Utility functions for DDPM experiemnt

docs/diffusion/ddpm/utils.html

latest537 B
Original Source

homediffusionddpm

View code on Github

#

Utility functions for DDPM experiemnt

10importtorch.utils.data

#

Gather consts for t and reshape to feature map shape

13defgather(consts:torch.Tensor,t:torch.Tensor):

#

15c=consts.gather(-1,t)16returnc.reshape(-1,1,1,1)

labml.ai