dataset

class aitoolbox.torchtrain.data.dataset.BasicDataset(data)[source]

Bases: torch.utils.data.dataset.Dataset

Basic PyTorch dataset where each row (first dimension) represents the example

Parameters

data (list or torch.Tensor) – dataset

class aitoolbox.torchtrain.data.dataset.ListDataset(*data_lists)[source]

Bases: torch.utils.data.dataset.Dataset

Dataset wrapping lists

Each sample will be retrieved by indexing tensors along the first dimension. This is the list dataset version of PyTorch built-in TensorDataset.

Parameters

*data_lists (list) – data lists that have the same size of the first dimension. Input is represented as a list of data lists.

Examples

list_dataset_1 = [...]
list_dataset_2 = [...]
list_dataset_3 = [...]
ListDataset(list_dataset_1, list_dataset_2, list_dataset_3)