nvalchemi.training.ReductionContext#
- class nvalchemi.training.ReductionContext[source]#
Lightweight metadata bag flowing through the loss template pipeline.
A plain
dictsubclass used to pass metadata betweenBaseLossFunction.normalize(),mask(), andreduce(). Using a baredictinstead ofTypedDict(total=False)keeps the typetorch.compile-safe (Dynamo rejectsTypedDictwith optional keys).Conventional keys#
"weights"torch.TensorPer-sample weights for the final reduction. For energy losses with
per_atom=Truethis carries atom counts(B, 1); for force losses it may carry per-atom or per-component weights.