MolecularDiffusion.modules.models.syncogen.diffusion.loss.pairwise_distance¶
Pairwise distance loss for nearby atoms.
Classes¶
Pairwise distance loss for nearby atoms. |
Module Contents¶
- class MolecularDiffusion.modules.models.syncogen.diffusion.loss.pairwise_distance.PairwiseDistanceLoss(distance_threshold: float = 5.0, sqrd: bool = False, coef: float = 1.0, time_weighted: bool = False, square_time_weight: bool = False, t_threshold: float = None, normalize_threshold: bool = True)¶
Bases:
MolecularDiffusion.modules.models.syncogen.diffusion.loss.base.LossBasePairwise distance loss for nearby atoms.
- compute_loss(pred, target) torch.Tensor¶
Base per-graph pairwise distance loss (no time weighting or coef).
Uses target.atom_mask (ground truth mask) to only consider distances between real atoms.
- forward(pred, target, t: torch.Tensor = None) torch.Tensor¶
Compute loss -> optional time weight -> threshold -> coef.
- distance_threshold = 5.0¶
- sqrd = False¶