xnn.common.benchmark.metrics.prediction_pairs#
- xnn.common.benchmark.metrics.prediction_pairs(out, data, targets, atomic_energies=None, energy_per_atom=True)[source]#
The scored
(prediction, reference)pairs of one batch, as flat detached tensors.The per-batch step of
collect_predictions()(see there for the energy handling and which labels are scored); the trainer accumulates its error metrics from the same pairs.- Parameters:
out (dict of str to Tensor) – The model output for
data.data (AtomicGraph) – The batch with its labels.
targets (list of str) – Quantities to pair, as in
collect_predictions().atomic_energies (torch.Tensor or None, optional) – Per-element reference energies to subtract, as in
collect_predictions().energy_per_atom (bool, optional) – Divide energies by the atom count. Defaults to
True.
- Returns:
The targets present in the batch and in
out, on the batch’s device.- Return type:
dict of str to (Tensor, Tensor)