MolecularDiffusion.modules.models.tabasco.flow.time_factor¶
Classes¶
Return a scalar weight per sample based on the interpolation time. |
|
Weight ~ 1 / (1 - t)^2 as used in the Proteina paper. |
|
Weight ~ t / (1 - t) (signal-to-noise ratio). |
|
Weight ~ 1 / (t^2 + 1e-2) |
|
Weight ~ (t / (1 - t))^2 (squared SNR). |
|
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.ABCReturn 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:
BaseTimeFactorWeight ~ 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:
BaseTimeFactorWeight ~ 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:
BaseTimeFactorWeight ~ 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:
BaseTimeFactorWeight ~ (t / (1 - t))^2 (squared SNR).
- forward(t: torch.Tensor) torch.Tensor¶
Return (t / (1 - t))^2 clamped to [min_value, max_value].