MultipleESPTarget
- model openff.nagl.training.loss.MultipleESPTarget[source]
A target that is evaluated on the electrostatic potential of a molecule.
- Fields:
- field charge_label: str [Required]
- field esp_length_column: str [Required]
- field inverse_distance_matrix_column: str [Required]
- field n_esp_column: 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
orDGLMoleculeBatch
) – 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 errorspredictions (
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.
- report_artifact(molecules: DGLMolecule | DGLMoleculeBatch, labels: Dict[str, Tensor], predictions: Dict[str, Tensor], output_directory: Path, top_n_entries: int = 100, bottom_n_entries: int = 100) Path [source]
Create a report of artifacts for this target for an MLFlowLogger.
- Parameters:
molecules (
DGLMolecule
orDGLMoleculeBatch
) – 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 errorspredictions (
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 errorsoutput_directory (
pathlib.Path
) – The directory to output the report to.top_n_entries (
int
, optional) – The number of top-ranked entries to include in the report.bottom_n_entries (
int
, optional) – The number of bottom-ranked entries to include in the report.
- Returns:
pathlib.Path
– The path to the report.