dmme#

LightningModules#

LitDDPM

LitDDIM

LitIDDPM

DataModule

CIFAR10

DataModules#

CIFAR10

LSUN

Common functions#

gaussian

Samples from gaussian with specified shape, dtype, device using torch.randn

gaussian_like

Samples from gaussian like the tensor x using torch.randn_like

uniform_int

Samples ints from uniform distribution using torch.randint

norm

Normalize input to \([-1, 1]\) linearly

denorm

Denormalize input normalized to \([-1, 1]\) linearly back to \([0, 1]\)

make_history

Visualize diffusion process given an array of histories

dmme.gaussian(shape, dtype=None, device=None)[source]#

Samples from gaussian with specified shape, dtype, device using torch.randn

dmme.gaussian_like(x)[source]#

Samples from gaussian like the tensor x using torch.randn_like

dmme.uniform_int(min, max, count=1, device=None)[source]#

Samples ints from uniform distribution using torch.randint

dmme.norm(x)[source]#

Normalize input to \([-1, 1]\) linearly

dmme.denorm(x)[source]#

Denormalize input normalized to \([-1, 1]\) linearly back to \([0, 1]\)

dmme.make_history(history)[source]#

Visualize diffusion process given an array of histories

Parameters:

history (List[torch.Tensor]) – list of diffusion history with each item as a tensor of shape \((N, C, H, W)\)