otx.core.utils.instantiators#
Instantiator functions for OTX engine components.
Functions
|
Instantiate a list of callbacks based on the provided configuration. |
|
Instantiate loggers based on the provided logger configuration. |
|
Instantiate a sampler object based on the provided configuration. |
Partially instantiates a class with the given initialization arguments. |
- otx.core.utils.instantiators.instantiate_callbacks(callbacks_cfg: list) list[Callback] [source]#
Instantiate a list of callbacks based on the provided configuration.
- otx.core.utils.instantiators.instantiate_loggers(logger_cfg: list | None) list[Logger] [source]#
Instantiate loggers based on the provided logger configuration.
- otx.core.utils.instantiators.instantiate_sampler(sampler_config: SamplerConfig, dataset: Dataset, **kwargs) Sampler [source]#
Instantiate a sampler object based on the provided configuration.
- Parameters:
sampler_config (SamplerConfig) – The configuration object for the sampler.
dataset (Dataset) – The dataset object to be sampled.
**kwargs – Additional keyword arguments to be passed to the sampler’s constructor.
- Returns:
The instantiated sampler object.
- Return type:
Sampler
- otx.core.utils.instantiators.partial_instantiate_class(init: list | dict | None) list[partial] | None [source]#
Partially instantiates a class with the given initialization arguments.
Copy from lightning.pytorch.cli.instantiate_class and modify it to use partial.
- Parameters:
init (list | dict | None) – A dictionary containing the initialization arguments. It should have the following each keys: - “init_args” (dict): A dictionary of keyword arguments to be passed to the class constructor. - “class_path” (str): The fully qualified path of the class to be instantiated.
- Returns:
A partial object representing the partially instantiated class.
- Return type:
list[partial] | None