noether.core.schemas.optimizers¶
Attributes¶
Classes¶
Configuration for a parameter group modifier. Both for the LrScaleByNameModifier and the WeightDecayByNameModifier, |
|
Configuration of the secondary optimizer in |
|
Base configuration for optimizers. |
|
Configuration for Adam-family optimizers (AdamW, Lion). |
|
Configuration for SGD. |
|
Configuration for |
Module Contents¶
- class noether.core.schemas.optimizers.ParamGroupModifierConfig(/, **data)¶
Bases:
pydantic.BaseModelConfiguration for a parameter group modifier. Both for the LrScaleByNameModifier and the WeightDecayByNameModifier,
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: str | None = None¶
The class path of the parameter group modifier. Either noether.core.optimizer.param_group_modifiers.LrScaleByNameModifier or noether.core.optimizer.param_group_modifiers.WeightDecayByNameModifier.
- scale: float | None = None¶
The scaling factor for the learning rate. Must be greater than 0.0. Only for the LrScaleByNameModifier.
- value: float | None = None¶
The weight decay value. With 0.0 the parameter is excluded from the weight decay. Only for the WeightDecayByNameModifier.
- check_scale_or_value_exclusive()¶
Validates that either ‘scale’ or ‘value’ is provided, but not both. This is a model-level validator that runs after individual field validation.
- Return type:
Self
- class noether.core.schemas.optimizers.MuonSecondaryOptimizerConfig(/, **data)¶
Bases:
pydantic.BaseModelConfiguration of the secondary optimizer in
MuonComposite.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- lr: float | None = None¶
The learning rate for the optimizer. Falls back to the primary lr if not set.
- class noether.core.schemas.optimizers.OptimizerConfig(/, **data)¶
Bases:
pydantic.BaseModelBase configuration for optimizers.
Holds fields common to all optimizers plus the wrapper-level options. Optimizer-specific fields live on the dedicated subclasses.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- weight_decay: float | None = None¶
The weight decay. Falls back to the primary weight_decay if not set.
- param_group_modifiers_config: list[ParamGroupModifierConfig] | None = None¶
List of parameter group modifiers to apply. These can modify the learning rate or weight decay for specific parameters.
- exclude_bias_from_weight_decay: bool = True¶
If true, excludes the bias parameters (i.e., parameters that end with ‘.bias’) from the weight decay. Default true.
- class noether.core.schemas.optimizers.AdamOptimizerConfig(/, **data)¶
Bases:
OptimizerConfigConfiguration for Adam-family optimizers (AdamW, Lion).
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: Literal['torch.optim.AdamW', 'noether.core.optimizer.Lion'] = 'torch.optim.AdamW'¶
The class path of the torch optimizer to use. E.g., ‘torch.optim.AdamW’.
- class noether.core.schemas.optimizers.SGDOptimizerConfig(/, **data)¶
Bases:
OptimizerConfigConfiguration for SGD.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: Literal['torch.optim.SGD'] = 'torch.optim.SGD'¶
The class path of the torch optimizer to use. E.g., ‘torch.optim.AdamW’.
- class noether.core.schemas.optimizers.MuonOptimizerConfig(/, **data)¶
Bases:
OptimizerConfigConfiguration for
MuonComposite.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- kind: Literal['noether.core.optimizer.MuonComposite'] = 'noether.core.optimizer.MuonComposite'¶
The class path of the torch optimizer to use. E.g., ‘torch.optim.AdamW’.
- secondary: MuonSecondaryOptimizerConfig | None = None¶
Configuration of the secondary optimizer in
MuonComposite.
- noether.core.schemas.optimizers.AnyOptimizerConfig¶