nvalchemi.training.ComposedLossOutput#

class nvalchemi.training.ComposedLossOutput[source]#

Output returned by ComposedLossFunction.

This is solely used as a type hint, and not as a concrete data structure; it’s used to signal to users that the emitted dict from composed losses will always at least contain the keys within this TypedDict.

The mapping always contains total_loss and four per-component sub-mappings keyed by component name. per_component_unweighted holds each raw component loss before multiplication by its effective weight. per_component_weight holds the effective (possibly normalized) weight actually applied to each component at this call; per_component_raw_weight holds the pre-normalization resolved weight — identical to per_component_weight when normalize_weights=False and useful for logging the underlying schedule value regardless of normalization. per_component_sample carries per-component weighted per-sample loss tensors of shape (B,), detached; see BaseLossFunction.per_sample_loss for the per-leaf populate-or-skip contract.