Dataset Structures

Dataset base class extending the PyTorch Dataset class specifications.

class ecgan.training.datasets.BaseDataset(*args, **kwds)[source]

Bases: torch.utils.data.dataset.Dataset, abc.ABC

Extend PyTorch Dataset class with explicit sampling and __len__ function.

sample(batch_size)[source]

Sample a batch directly from the dataset.

Parameters

batch_size (int) -- Amount of samples to sample.

Return type

Dict

Returns

Dict containing the samples and its attributes.

class ecgan.training.datasets.SeriesDataset(data, label)[source]

Bases: ecgan.training.datasets.BaseDataset

PyTorch Dataset class for time series that are preprocessed using ecgan-preprocess.