CPSC2019Dataset#

class torch_ecg.databases.datasets.CPSC2019Dataset(config: CFG, training: bool = True, lazy: bool = False, **reader_kwargs: Any)[source]#

Bases: ReprMixin, Dataset

Data generator for feeding data into pytorch models using the CPSC2019 database.

Parameters:
  • config (dict) –

    Configurations for the dataset, ref. CPSC2019TrainCfg. A simple example is as follows:

    >>> config = deepcopy(CPSC2019TrainCfg)
    >>> config.db_dir = "some/path/to/db"
    >>> dataset = CPSC2019Dataset(config, training=True, lazy=False)
    

  • training (bool, default True) – If True, the training set will be loaded, otherwise the test (val) set will be loaded.

  • lazy (bool, default True) – If True, the data will not be loaded immediately, instead, it will be loaded on demand.

  • **reader_kwargs (dict, optional) – Keyword arguments for the database reader class.

extra_repr_keys() List[str][source]#

Extra keys for __repr__() and __str__().

property labels: ndarray#

Cached labels, only available when lazy=False or preloading is performed manually.

property signals: ndarray#

Cached signals, only available when lazy=False or preloading is performed manually.