HeavyAtomReadoutTarget

model openff.nagl.training.loss.HeavyAtomReadoutTarget[source]

A target that is evaluated on the heavy atoms of the readout of a molecule,

Fields:
field name: Literal['heavy_atom_readout'] = 'heavy_atom_readout'
field prediction_label: str [Required]
evaluate_target(molecules: DGLMolecule | DGLMoleculeBatch, labels: Dict[str, Tensor], predictions: Dict[str, Tensor], readout_modules: Dict[str, ReadoutModule]) Tensor[source]

Evaluate the target property for a molecule or batch of molecules. This does not need to account for the denominator and weight, which will be factored in evaluate.

Parameters:
  • molecules (DGLMolecule or DGLMoleculeBatch) – The molecule(s) to evaluate the target for.

  • labels (Dict[str, torch.Tensor]) – The labels for the molecule(s). If molecules is a batch, the values of these will be contiguous arrays, which should be split for molecular-based errors

  • predictions (Dict[str, torch.Tensor]) – The predictions for the molecule(s). If molecules is a batch, the values of these will be contiguous arrays, which should be split for molecular-based errors

Returns:

torch.Tensor – The loss for the molecule(s).

get_required_columns() List[str][source]

Target columns used in this target.

This method is used to determine which columns to extract from the parquet datasets.