param_ranges#

Tuning range types and metadata for hyperparameter search spaces.

Range types (FloatRange, IntRange, CategoricalRange) are frozen dataclasses used as Annotated metadata on HyperParams fields, where Pydantic treats plain dataclasses as opaque field metadata.

ModelTuningInfo is a Pydantic model used outside Annotated context.

Functions#

get_tuning_range(field_info)

Return the first TuningRange found in a Pydantic FieldInfo's metadata.

Classes#

CategoricalRange([choices, tune])

Annotate a HyperParams field as tunable over discrete choices.

FloatRange([low, high, log, tune])

Annotate a HyperParams float field as tunable within [low, high].

IntRange([low, high, log, tune])

Annotate a HyperParams int field as tunable within [low, high].

ModelTuningInfo(**data)

Groups a hyperparameter config with its resolved search space.