IBLBrainWideBenchMultiTaskBehavior#

class pretrain.datasets.IBLBrainWideBenchMultiTaskBehavior(root, split, tasks, dirname='ibl_brain_wide_bench_2026', recording_ids=None, transform=None, normalize_behavior=True)[source]#

Bases: core.dataset.IBLBrainWideBench2026

Spikes aligned to several behavioral targets at once.

__getitem__ returns a single dict rather than an (input, target) pair, since the model’s input_fn emits the targets. Two samplings are offered: get_task_align_intervals() stacks one window per (task, trial), and get_trial_intervals() merges the regions where any task has data.

Parameters:
  • root (str) – Directory holding the build.

  • split (Literal['train', 'val', 'test']) – Which pretrain split to read, train or val.

  • dirname (str) – Name of the build directory under root.

  • recording_ids (Union[str, list[str], None]) – Recordings to load, or None for every pretrain recording.

  • transform (Optional[Any]) – Applied to each item, the model’s input_fn among them.

  • tasks (Union[Literal['choice', 'reward', 'stimulus_contrast', 'whisker_motion_energy', 'wheel_speed', 'right_paw_speed', 'left_paw_speed', 'licking_rate'], list[Literal['choice', 'reward', 'stimulus_contrast', 'whisker_motion_energy', 'wheel_speed', 'right_paw_speed', 'left_paw_speed', 'licking_rate']]]) – The TS1 tasks to align to, one or a list of them.

  • normalize_behavior (bool) – Whether to normalize the targets. Timestep-level signals are z-scored against the recording’s pretrain statistics, wheel_speed excepted; licking_rate is rounded into counts instead.

dataset_transform(data)[source]#

Defines dataset-level transformations that are applied to all recordings in the Dataset.

This method can be applied on an entire recording or a single slice.

Parameters:

data (Data) – The Data object to apply the transformations to.

Return type:

Data

Returns:

The Data object with the transformations applied.

Example

>>> dataset = IBLBrainWideBench2026(...)
>>> data = dataset.get_recording(...)
>>> data = dataset.dataset_transform(data)
>>> slice = data.slice(0.5, 1.5)
>>> slice = dataset.dataset_transform(slice)
get_trial_intervals()[source]#

Merged regions to sample fixed-length windows from.

Restricted to where at least one task has data. For RandomFixedWindowSampler, unlike the stacked per-trial windows of get_task_align_intervals().