Base Configuration#
- class ablator.config.main.ConfigBase(*args, **kwargs)[source]
This class is the building block for all configuration objects within ablator. It serves as the base class for configurations such as
ModelConfig,TrainConfig,OptimizerConfig, and more.To customize configurations for specific needs, you can create your own configuration class by inheriting from
ConfigBase. It’s essential to annotate it with@configclass. For instance, in the tutorial Search space for different types of optimizers and scheduler, a custom optimizer config class is created to enable ablation study on various optimizers and schedulers. You can refer to this tutorial for an example of how to create your custom configuration class.- Parameters:
- *argsAny
Positional arguments.
- **kwargsAny
Keyword arguments.
- Raises:
- ValueError
If positional arguments are provided.
- KeyError
If unexpected arguments are provided.
- RuntimeError
If the class is not decorated with
@configclass.
Note
All config class must be decorated with
@configclass.
Examples
>>> @configclass >>> class MyCustomConfig(ConfigBase): ... attr1: int = 1 ... attr2: Tuple[str, int, str]
- Attributes:
- config_classType
The class of the configuration object.