xnn.common.benchmark.config.ModelEntry#
- class xnn.common.benchmark.config.ModelEntry(label, model, checkpoint=None)[source]#
Bases:
objectOne model in a benchmark: its architecture plus the weights to score.
- Variables:
label (str) – Human-readable name for this entry in the results table. Defaults to the model name;
from_dict()disambiguates duplicates by suffix.model (dict[str, Any]) – The model section as a plain dict (already merged with any
configfile and with upstream key spellings translated). Turned into aModelConfigbyto_config(). Optional when the checkpoint was written bysave()and carries its own config: that stored architecture is used, so an entry can be as small as just acheckpoint. Supply the architecture here only for checkpoints that do not embed one.checkpoint (Optional[str]) – Path to the pre-trained checkpoint (as written by
save()) whose weights are loaded into the model before scoring. Required for the model to be benchmarked; defaults toNone.
- Parameters:
- to_config(bench, model=None)[source]#
Assemble the ordinary
Configused to build this model.Folds a model section together with the benchmark’s shared
datasection, device and seed, routing everything through the standardfrom_dict()funnel so model-key translation andextracollection behave exactly as in a single run. The synceddata.cutoff(kept in lockstep withmodel.cutoffbyConfig) is what the benchmark dataset’s neighbor list uses.- Parameters:
bench (BenchmarkConfig) – The parent benchmark configuration providing the shared data, device and seed.
model (dict[str, Any] or None, optional) – The model section to build from. Defaults to this entry’s
model; the runner passes the architecture read from the checkpoint here so a checkpoint’s own config is used.
- Returns:
A run configuration for this model (model + data + device + seed).
- Return type: