drugforge.ml.loss.GaussianNLLLoss
- class drugforge.ml.loss.GaussianNLLLoss(*args: Any, **kwargs: Any)[source]
Bases:
GaussianNLLLoss- __init__(include_semiquant=True, fill_value=None)[source]
Class for calculating Gaussian NLL loss, with various options.
- Parameters:
include_semiquant (bool, default=True) – Whether to include semi-quantitative samples in the loss
fill_value (float, optional) – If provided, use this value as the uncertainty for all semiquant predictions
Methods
__init__([include_semiquant, fill_value])Class for calculating Gaussian NLL loss, with various options.
forward(pred, pose_preds, target, in_range, ...)Loss calculation
- forward(pred, pose_preds, target, in_range, uncertainty)[source]
Loss calculation
- Parameters:
pred (torch.Tensor) – Model prediction
pose_preds (torch.Tensor) – Predictions for each pose
target (torch.Tensor) – Prediction target
in_range (torch.Tensor) – target’s presence in the dynamic range of the assay. Give a value of < 0 for target below lower bound, > 0 for target above upper bound, and 0 or None for inside range
uncertainty (torch.Tensor) – Uncertainty in target measurements