experanto.dataloaders.get_multisession_dataloader
- get_multisession_dataloader(paths, configs=None, shuffle_keys=False, **kwargs)[source]
Create a multi-session dataloader from multiple experiment paths.
By default, creates a
ChunkDatasetfor each path and wraps them in aLongCyclerthat yields(session_key, batch)pairs. The cycler continues until the longest session is exhausted.- Parameters:
configs (dict, DictConfig, list, optional) – Configuration for each dataset. If a single config is provided, it will be applied to all datasets. If a list is provided, it should match the length of
paths. Each config should havedatasetanddataloaderkeys.shuffle_keys (bool, default=False) – Whether to shuffle the order of session keys.
**kwargs – Additional keyword arguments. Supports
configas an alias forconfigs.
- Returns:
A dataloader-like object that yields
(session_key, batch)tuples. Iterates until the longest session is exhausted.- Return type:
See also
get_multisession_concat_dataloaderAlternative that concatenates sessions.
LongCyclerThe underlying multi-session iterator.
Examples
>>> from experanto.dataloaders import get_multisession_dataloader >>> from experanto.configs import DEFAULT_CONFIG >>> paths = ['/path/to/exp1', '/path/to/exp2'] >>> loader = get_multisession_dataloader(paths, configs=DEFAULT_CONFIG) >>> for session_key, batch in loader: ... print(f"Session: {session_key}, batch shape: {batch['responses'].shape}")