vis4d.config.typing
Type definitions for configuration files.
Classes
|
Configuration for a data set. |
|
Configuration for an experiment. |
|
Parameters for an experiment. |
|
Configuration for a learning rate scheduler. |
|
Configuration for an optimizer. |
Parameter group config. |
|
|
Configuration for a parameter sweep. |
- class ParamGroupCfg[source]
Parameter group config.
- custom_keys
List of custom keys.
- Type:
list[str]
- lr_mult
Learning rate multiplier.
- Type:
NotRequired[float]
- decay_mult
Weight Decay multiplier.
- Type:
NotRequired[float]
- class DataConfig(initial_dictionary=None, type_safe=True, convert_dict=True, *, allow_dotted_keys=False, sort_keys=True)[source]
Configuration for a data set.
This data object is used to configure the training and test data of an experiment. In particular, the train_dataloader and test_dataloader need to be config dicts that can be instantiated as a dataloader.
- train_dataloader
Configuration for the training dataloader.
- Type:
ConfigDict
- test_dataloader
Configuration for the test dataloader.
- Type:
ConfigDict
Example
>>> from vis4d.config.types import DataConfig >>> from vis4d.zoo.base import class_config >>> from my_package.data import MyDataLoader >>> cfg = DataConfig() >>> cfg.train_dataloader = class_config(MyDataLoader, ...)
- class LrSchedulerConfig(initial_dictionary=None, type_safe=True, convert_dict=True, *, allow_dotted_keys=False, sort_keys=True)[source]
Configuration for a learning rate scheduler.
- scheduler
Configuration for the learning rate scheduler.
- Type:
ConfigDict
- begin
Begin epoch.
- Type:
int
- end
End epoch.
- Type:
int
- epoch_based
Whether the learning rate scheduler is epoch based or step based.
- Type:
bool
- convert_epochs_to_steps
Whether to convert the begin and end for a step based scheduler to steps automatically based on length of train dataloader. Enables users to set the iteration breakpoints as epochs. Defaults to False.
- Type:
bool
- convert_attributes
List of attributes in the scheduler that should be converted to steps. Defaults to None.
- Type:
list[str] | None
- class OptimizerConfig(initial_dictionary=None, type_safe=True, convert_dict=True, *, allow_dotted_keys=False, sort_keys=True)[source]
Configuration for an optimizer.
- optimizer
Configuration for the optimizer.
- Type:
ConfigDict
- lr_scheduler
Configuration for the learning rate scheduler.
- Type:
list[LrSchedulerConfig] | None
- param_groups
Configuration for the parameter groups.
- Type:
list[ParamGroupCfg] | None
- class ExperimentParameters(initial_dictionary=None, type_safe=True, convert_dict=True)[source]
Parameters for an experiment.
- samples_per_gpu
Number of samples per GPU.
- Type:
int
- workers_per_gpu
Number of workers per GPU.
- Type:
int
- class ExperimentConfig(initial_dictionary=None, type_safe=True, convert_dict=True)[source]
Configuration for an experiment.
This data object is used to configure an experiment. It contains the minimal required configuration to run an experiment. In particular, the data, model, optimizers, and loss need to be config dicts that can be instantiated as a data set, model, optimizer, and loss function, respectively.
- work_dir
The working directory for the experiment.
- Type:
str | FieldReference
- experiment_name
The name of the experiment.
- Type:
str | FieldReference
- timestamp
The timestamp of the experiment.
- Type:
str | FieldReference
- version
The version of the experiment.
- Type:
str | FieldReference
- output_dir
The output directory for the experiment.
- Type:
str | FieldReference
- seed
The random seed for the experiment.
- Type:
int | FieldReference
- log_every_n_steps
The number of steps after which the logs should be written.
- Type:
int | FieldReference
- use_tf32
Whether to use tf32.
- Type:
bool | FieldReference
- benchmark
Whether to enable benchmarking.
- Type:
bool | FieldReference
- params
Configuration for the experiment parameters.
- Type:
- data
Configuration for the dataset.
- Type:
- model
Configuration for the model.
- Type:
FieldConfigDictOrRef
- loss
Configuration for the loss function.
- Type:
FieldConfigDictOrRef
- optimizers
Configuration for the optimizers.
- Type:
list[OptimizerConfig]
- data_connector
Configuration for the data connector.
- Type:
FieldConfigDictOrRef
- callbacks
Configuration for the callbacks which are used in the engine.
- Type:
list[FieldConfigDictOrRef]
- class ParameterSweepConfig(initial_dictionary=None, type_safe=True, convert_dict=True)[source]
Configuration for a parameter sweep.
Confguration object for a parameter sweep. It contains the minimal required configuration to run a parameter sweep.
- method
Sweep method that should be used (e.g. grid)
- Type:
str
- sampling_args
Arguments that should be passed to the sweep method. E.g. for grid, this would be a list of tuples of the form (parameter_name, parameter_values).
- Type:
list[tuple[str, Any]]
- suffix
Suffix that should be appended to the output directory. This will be interpreted as a string template and can contain references to the sampling_args. E.g. “lr_{lr:.2e}_bs_{batch_size}”.
- Type:
str