function

language.params

def params(cls: type[T] | None = None, prefix: str = '', exclude: bool = False, hidden: typing.Iterable[str] | None = None) -> type[T]

Create a class that represents a set of hyperparameters.

Accessing an attribute returns an interpolation reference; calling the wrapper returns a plain ``dict`` of the declared values. Decorated classes type-check as dataclasses thanks to :pep:`681` ``dataclass_transform``: annotated fields (``foo: int = 1``) are treated as real dataclass fields by pyright. At runtime the decoration returns a :class:`ParamsWrapper` that emits interpolation references on attribute access.

Parameters

NameTypeDescription
prefix = ``""``strCLI flag prefix for ``laco app``. ``""`` (default) exposes fields flat (``--lr``). ``None`` uses the class variable name as prefix (``--hps-lr``). Any other string is used verbatim (``--train-lr``).
exclude = ``False``boolWhen ``True`` the entire block is hidden from ``laco app``.
hidden = Noneiterable of strIndividual field names to hide from ``laco app`` while keeping them in the config. An alternative to :class:`Hidden` annotations.

Source: laco/language.py:1309