aibedo.interface.get_datamodule

aibedo.interface.get_datamodule(config: omegaconf.dictconfig.DictConfig) aibedo.datamodules.abstract_datamodule.AIBEDO_DataModule[source]

Get the datamodule, as defined by the key value pairs in config.datamodule. A datamodule defines the data-loading logic as well as data related (hyper-)parameters like the batch size, number of workers, etc.

Parameters

config (DictConfig) – A OmegaConf config (e.g. produced by hydra <config>.yaml file parsing)

Returns

AIBEDO_DataModule – A datamodule that you can directly use to train pytorch-lightning models

Examples:

from aibedo.utilities.config_utils import get_config_from_hydra_compose_overrides

cfg = get_config_from_hydra_compose_overrides(overrides=['datamodule=icosahedron', 'datamodule.order=5'])
ico_dm = get_datamodule(cfg)
print(f"Icosahedron datamodule with order {ico_dm.order}")