nvalchemi.training.distillation.scorer_fields#
- nvalchemi.training.distillation.scorer_fields(scorer)[source]#
Return the batch fields scorer populates, or
Nonewhen they cannot be known.A
label_fieldsdeclaration is taken at its word; otherwise a scorer whose signals are all built in getssignal_fields()of them, companion fields included; otherwise the fields are unknown, since a custom signal may map onto any field.Noneis not(): a scorer that labels nothing declares(), while an undeclared scorer with a custom signal resolves toNone, which a consumer must treat as unknown rather than as nothing to check.- Parameters:
scorer (TeacherScorer) – Scorer to resolve the fields of.
- Returns:
Batch field names the scorer writes, or
Nonewhen they cannot be determined without scoring a batch.- Return type:
tuple[str, …] | None
- Raises:
TypeError – If scorer declares
label_fieldsas a string, which would otherwise resolve to its characters.