xnn.common.benchmark.config.ModelEntry#

class xnn.common.benchmark.config.ModelEntry(label, model, checkpoint=None)[source]#

Bases: object

One 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 config file and with upstream key spellings translated). Turned into a ModelConfig by to_config(). Optional when the checkpoint was written by save() and carries its own config: that stored architecture is used, so an entry can be as small as just a checkpoint. 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 to None.

Parameters:
to_config(bench, model=None)[source]#

Assemble the ordinary Config used to build this model.

Folds a model section together with the benchmark’s shared data section, device and seed, routing everything through the standard from_dict() funnel so model-key translation and extra collection behave exactly as in a single run. The synced data.cutoff (kept in lockstep with model.cutoff by Config) 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:

Config