xnn.common.config.options#

Config options that nothing uses are ignored, with a warning.

A registered model’s from_config reads its options (ModelConfig.extra) through model_options(), which records every key read and the default a missing one falls back to; so do the build steps around it (pretrained weights, LoRA, heads, dispersion, long-range). build_model() then warns about the options that nothing read, and the config loaders about keys they do not know: a misspelled option, or one carried over from another code’s config (whose keys the translation tables may not cover), is ignored, and the user is told so. The resolved options (those given and the defaults used, ModelOptions.resolved()) are what a saved model records, so that it rebuilds as it was trained whatever later versions choose as defaults.

Module Attributes

CONFIG_KEYS

fit_scaling by the trainer, species by the exporters (recorded with every model).

Functions

model_options(cfg)

The options of a model config, for a from_config to read.

warn_ignored(where, keys)

Warn that keys of where are ignored (nothing for no keys).

Classes

ModelOptions([values, read, defaults])

A copy of ModelConfig.extra that records which options are read.

Exceptions

IgnoredOptionWarning

A config key or option that xnn does not use, and ignores.