agedi.diffusion.samplers.em¶
Euler-Maruyama sampler — one score call per reverse step.
Classes¶
Standard Euler-Maruyama reverse-SDE sampler. |
Module Contents¶
- class agedi.diffusion.samplers.em.EulerMaruyamaSampler(score_fn: Callable[[agedi.data.AtomsGraph], agedi.data.AtomsGraph], noisers: List[agedi.diffusion.noisers.Noiser])¶
Bases:
agedi.diffusion.samplers.base.SamplerStandard Euler-Maruyama reverse-SDE sampler.
Performs one score-model evaluation per reverse step and delegates the position update to each noiser’s
denoise()method. The update formula used (EM or DDPM posterior mean) is controlled by thesamplerattribute of eachPositionsNoiser.This is the default sampler and exactly reproduces the behaviour of
reverse_step()(minus guidance and timings).- Parameters:
score_fn (callable) – Score-model forward function.
noisers (list of Noiser) – Noisers in forward order.
- step(batch: agedi.data.AtomsGraph, dt: torch.Tensor, last: bool) agedi.data.AtomsGraph¶
Euler-Maruyama reverse step.
Evaluate score model.
Apply each noiser’s denoising update in reverse order.
Wrap positions and rebuild the neighbour list.