MolecularDiffusion.modules.models.ligandiff.noise¶
Diffusion noise schedules. Verbatim port of LigandDiff’s src/noise.py.
Both branches matter: polynomial_2 is upstream’s config.yml default
for fresh training, while the released model/pretrained.ckpt was trained
with the learned GammaNetwork (its edm.gamma.{gamma_0,gamma_1,l1,l2,l3}
tensors are in the checkpoint). Selecting the wrong one makes those eight
tensors arrive as unexpected keys, which cli/generate.py’s
strict=False load silently drops.
Classes¶
Monotonic learned gamma schedule (VDM paper construction). |
|
Linear layer with weights forced to be positive. |
|
Lookup table for a fixed (non-learned) noise schedule. |
Functions¶
|
Clip alpha_t / alpha_{t-1} for sampling stability. |
|
Cosine schedule (Nichol & Dhariwal). |
|
Noise schedule based on |
Module Contents¶
- class MolecularDiffusion.modules.models.ligandiff.noise.GammaNetwork¶
Bases:
torch.nn.ModuleMonotonic learned gamma schedule (VDM paper construction).
- forward(t)¶
- gamma_tilde(t)¶
- gamma_0¶
- gamma_1¶
- l1¶
- l2¶
- l3¶
- class MolecularDiffusion.modules.models.ligandiff.noise.PositiveLinear(in_features: int, out_features: int, bias: bool = True, weight_init_offset: int = -2)¶
Bases:
torch.nn.ModuleLinear layer with weights forced to be positive.
- forward(x)¶
- in_features¶
- out_features¶
- weight¶
- weight_init_offset = -2¶
- class MolecularDiffusion.modules.models.ligandiff.noise.PredefinedNoiseSchedule(noise_schedule, timesteps, precision)¶
Bases:
torch.nn.ModuleLookup table for a fixed (non-learned) noise schedule.
- forward(t)¶
- gamma¶
- timesteps¶
- MolecularDiffusion.modules.models.ligandiff.noise.clip_noise_schedule(alphas2, clip_value=0.001)¶
Clip alpha_t / alpha_{t-1} for sampling stability.