experanto.utils.SessionConcatDataset

class SessionConcatDataset(*args, **kwargs)[source]

Bases: Dataset

Memory-efficient concatenated dataset that reliably tracks sessions.

Methods

__init__(datasets[, session_names])

Initialize the concatenated dataset with session tracking.

get_indices_for_session(session_name)

Get all indices belonging to a given session.

get_session_for_idx(idx)

Get the session name for a given index.

get_sessions_count()

Get number of sessions and count of samples per session.

__init__(datasets, session_names=None)[source]

Initialize the concatenated dataset with session tracking.

__len__()[source]

Return total length of the concatenated dataset.

__getitem__(idx)[source]

Get item from the appropriate dataset.

get_session_for_idx(idx)[source]

Get the session name for a given index.

get_indices_for_session(session_name)[source]

Get all indices belonging to a given session.

get_sessions_count()[source]

Get number of sessions and count of samples per session.