personalitylinmult.data.datamodule¶
Lightning DataModule over the built FI HDF5 file.
Attributes¶
Module-level logger. |
Classes¶
Serves the FI splits from the single HDF5 artifact. |
Functions¶
|
Seed a dataloader worker's RNGs from torch's per-worker seed. |
Module Contents¶
- personalitylinmult.data.datamodule.logger¶
Module-level logger.
- personalitylinmult.data.datamodule.seed_worker(worker_id: int) None[source]¶
Seed a dataloader worker’s RNGs from torch’s per-worker seed.
Without this, every worker inherits the parent’s numpy seed and augmentation draws repeat across workers.
- Parameters:
worker_id (int) – Worker index, unused but required by the hook.
- class personalitylinmult.data.datamodule.FiDataModule(config: personalitylinmult.train.config.DataConfig, target_names: list[str])[source]¶
Bases:
lightning.LightningDataModuleServes the FI splits from the single HDF5 artifact.
- Parameters:
config (DataConfig) – Dataloader configuration.
target_names (list[str]) – Label columns for the active task, in head order.
- prepare_data_per_node¶
If True, each LOCAL_RANK=0 will call prepare data. Otherwise only NODE_RANK=0, LOCAL_RANK=0 will prepare data.
- allow_zero_length_dataloader_with_multiple_devices¶
If True, dataloader with zero length within local rank is allowed. Default value is False.
- setup(stage: str | None = None) None[source]¶
Construct the datasets needed for a stage.
- Parameters:
stage (str | None) –
"fit","validate","test", orNonefor all.
- train_dataloader() torch.utils.data.DataLoader[source]¶
Training loader.
- Returns:
Shuffled, drop-last loader over the train split.
- Return type:
DataLoader
- Raises:
RuntimeError – If called before
setup.