nvalchemi.training.distillation.evaluation.AcceptanceBar#
- class nvalchemi.training.distillation.evaluation.AcceptanceBar(name, families, check='', attribute='', comparison='<=', quantities=(), missing='')[source]#
Where one acceptance bar reads the number it gates, and which way it passes.
An acceptance bar is a limit that one number from a student’s measurements must clear for the student to be accepted. The built-in bars are
DEFAULT_BARS. To register a custom bar, pass a table that includes it tobuild_acceptance_report()andmeasured_bars(). Set its limit under its name inAcceptanceThresholds.extra, and file its number under its family inStudentEvaluation.extra.- Parameters:
name (str) – Name the bar’s limit is set under: a field of
AcceptanceThresholdsfor a built-in bar, or a key of itsextrafor a custom one.families (tuple[str, ...]) – Measurement slots the bar reads. A slot of
StudentEvaluationnames a typed measurement."extra:<family>"names a map of numbers underStudentEvaluation.extra.check (str, optional) – Row the bar reports under. Unless attribute overrides it, this is also the field or key the bar reads from its first family. Required for every bar but the built-in from-scratch ratio, which spans two families and is computed by the report itself. Default
"".attribute (str, optional) – Field or key read when it differs from check. Default
"".comparison ({"<=", ">="}, optional) – Direction the check passes in. Default
"<=".quantities (tuple[str, ...], optional) – Accuracy quantities, any one of which is enough to decide the bar.
measured_bars()uses them to narrow its answer. Default().missing (str, optional) – Detail reported when the family was supplied but the number it reads was not. Default
"".
- Raises:
ValueError – If name or families is empty, if check is empty for any bar but the from-scratch ratio, if a family is neither a measurement slot nor an
"extra:"family, or if comparison is not"<="or">=".
Examples
>>> from nvalchemi.training.distillation.evaluation import ( ... DEFAULT_BARS, ... AcceptanceBar, ... ) >>> dipole_bar = AcceptanceBar( ... "max_dipole_mae", ("extra:dipole",), "dipole_mae" ... ) >>> bars = (*DEFAULT_BARS, dipole_bar)