MolecularDiffusion.modules.models.tabasco.flow.time_factor

Classes

BaseTimeFactor

Return a scalar weight per sample based on the interpolation time.

InverseTimeFactor

Weight ~ 1 / (1 - t)^2 as used in the Proteina paper.

SignalToNoiseTimeFactor

Weight ~ t / (1 - t) (signal-to-noise ratio).

SquareTimeFactor

Weight ~ 1 / (t^2 + 1e-2)

SquaredSignalToNoiseTimeFactor

Weight ~ (t / (1 - t))^2 (squared SNR).

ZeroTimeFactor

Weight = 0 for all t

Module Contents

class MolecularDiffusion.modules.models.tabasco.flow.time_factor.BaseTimeFactor(max_value: float, min_value: float = 0.05, zero_before: float = 0.0, eps: float = 1e-06)

Bases: torch.nn.Module, abc.ABC

Return a scalar weight per sample based on the interpolation time.

Parameters:
  • max_value – Upper clamp for the time-factor value.

  • min_value – Lower clamp for the time-factor value.

  • zero_before – If t ≤ this threshold the factor is forced to zero.

  • eps – Small constant to avoid division by zero.

abstractmethod forward(t: torch.Tensor) torch.Tensor

Return the time-factor for each element in t.

eps = 1e-06
max_value
min_value = 0.05
zero_before = 0.0
class MolecularDiffusion.modules.models.tabasco.flow.time_factor.InverseTimeFactor(max_value: float = 100.0, min_value: float = 0.05, zero_before: float = 0.0, eps: float = 1e-06)

Bases: BaseTimeFactor

Weight ~ 1 / (1 - t)^2 as used in the Proteina paper.

forward(t: torch.Tensor) torch.Tensor

Return 1 / (1 - t)^2 clamped to [min_value, max_value].

class MolecularDiffusion.modules.models.tabasco.flow.time_factor.SignalToNoiseTimeFactor(max_value: float = 1.5, min_value: float = 0.05, zero_before: float = 0.0, eps: float = 1e-06)

Bases: BaseTimeFactor

Weight ~ t / (1 - t) (signal-to-noise ratio).

forward(t: torch.Tensor) torch.Tensor

Return t / (1 - t) clamped to [min_value, max_value].

class MolecularDiffusion.modules.models.tabasco.flow.time_factor.SquareTimeFactor(max_value: float, min_value: float = 0.05, zero_before: float = 0.0, eps: float = 1e-06)

Bases: BaseTimeFactor

Weight ~ 1 / (t^2 + 1e-2)

forward(t)

Return the time-factor for each element in t.

class MolecularDiffusion.modules.models.tabasco.flow.time_factor.SquaredSignalToNoiseTimeFactor(max_value: float = 1.5, min_value: float = 0.05, zero_before: float = 0.0, eps: float = 1e-06)

Bases: BaseTimeFactor

Weight ~ (t / (1 - t))^2 (squared SNR).

forward(t: torch.Tensor) torch.Tensor

Return (t / (1 - t))^2 clamped to [min_value, max_value].

class MolecularDiffusion.modules.models.tabasco.flow.time_factor.ZeroTimeFactor(max_value: float, min_value: float = 0.05, zero_before: float = 0.0, eps: float = 1e-06)

Bases: BaseTimeFactor

Weight = 0 for all t

forward(t)

Return the time-factor for each element in t.