Torch-ecg

Latest version: v0.0.31

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 6

0.0.19

----------------------------------------------------------------------------------------

Added
~~~~~

- Add argument ``relative`` to the utility function ``get_record_list_recursive3``.
- Add attribute ``_df_records`` to the database reader classes. The attribute
stores the DataFrame of the records of the database, containing paths to the
records and other information (labels, demographics, etc.).

Fixed
~~~~~

- Fix bugs in the download utility function ``http_get``.
- Fix bugs in the database reader classe ``CPSC2021``.

0.0.18

----------------------------------------------------------------------------------------

Added
~~~~~

- Add property ``in_channels`` for the models.The number of input channels
is stored as a private attribute ``_in_channels``, and the property
``in_channels`` makes it easier to access the value.
- Add warning message to the ``download`` method of the ``CPSC2019`` database
reader class.
- Add ``get_absolute_path`` method for the database reader classes to
uniformly handle the path operations.

Changed
~~~~~~~

- All all absolute imports are replaced with relative imports.
- Update citation and images for several benchmark studies
- Update the ``downlaod`` link for the ``CPSC2019`` database reader class
(ref. property ``torch_ecg.databases.CPSC2019.url``).

Removed
~~~~~~~

- Remove the ``torch_ecg.utils.misc.deprecate_kwargs`` decorator. It is
delivered in an isolated package ``deprecate_kwargs`` published on PyPI,
and added as a dependency in the ``requirements.txt`` file.

Fixed
~~~~~

- Fix errors in the ``_ls_rec`` method of the ``CPSC2019`` database reader
class.
- Fix bugs in the ``torch_ecg.utils.misc.deprecate_kwargs`` decorator.
- Fix the issue that ``tensorboardX`` is incompatible with the latest version
of ``protobuf``.

0.0.17

-----------------------------

This release was yanked.

0.0.16

----------------------------------------------------------------------------------------

Added
~~~~~

- Add method ``_categorize_records`` for the ``MITDB`` database reader class,
categorize records by specific attributes. Related helper properties
``beat_types_records`` and ``rhythm_types_records`` are added.
- Add method ``_aggregate_stats`` for the ``MITDB`` database reader class.
Related helper properties ``df_stats`` and ``db_stats`` are added.
- Add function ``cls_to_bin`` for converting categorical (typically multi-label)
class labels to binary class labels (2D array with 0/1 values).
- Add context manager ``torch_ecg.utils.misc.timeout`` for setting a timeout for
a block of code.
- Add context manager ``torch_ecg.utils.misc.Timer`` to time the execution of
a block of code.
- Add module ``torch_ecg.components.inputs`` for input data classes.
- Add class ``Spectrogram`` (in ``torch_ecg.utils``) for generating spectrogram
input data. This class is modified from the ``torchaudio.transforms.Spectrogram``.
- Add decorator ``torch_ecg.utils.misc.deprecate_kwargs`` for deprecating keyword
arguments of a function/method.
- Top-level module ``torch_ecg.ssl`` for self-supervised learning methods and
models is introduced, but not implemented yet.
- Add helper function ``torch_ecg.utils.utils_nn.compute_sequential_output_shape``
to simplify the computation of output shape of sequential models.
- ``mobilenet_v3`` model is added to the ``torch_ecg.models`` module. It is
now available as a cnn backbone choice for the ``ECG_CRNN`` model (and for other
downstream task models).

Changed
~~~~~~~

- Use ``numpy``'s default ``rng`` for random number generation in place
of ``np.random`` and Python built-in ``random`` module.
- Update the ``README`` file.
- Move the function ``generate_weight_mask`` from ``CPSC2021`` dataset
to ``torch_ecg.utils.utils_data``.
- Database reader ``MITDB`` is enhanced: add properties ``df_stats_expanded``;
add arguments ``beat_types`` and ``rhythm_types`` to the data and annotation
loading methods.
- Downloading function ``http_get`` is enhanced to support downloading
normal files other than compressed files.
- Update ``__init__`` file of the ``torch_ecg.utils`` module.
- Database reader class ``CinC2017`` is updated: add property ``_validation_set``.
- The ``ECG_UNET`` model is simplified by removing the unnecessary zero padding
along the channel axis.
- Update the ``README`` file.

Deprecated
~~~~~~~~~~

- Keyword argument ``batch_norm`` in model building blocks (ref. ``torch_ecg.models``)
is deprecated. Use ``norm`` instead.

Removed
~~~~~~~

- Redundant functions in ``torch_ecg.utils.utils_interval`` are removed:
``diff_with_step``, ``mask_to_intervals``.

Fixed
~~~~~

- Remove redudant code for the ``ECG_UNET`` model which might cause error in
computing output shapes.

0.0.15

----------------------------------------------------------------------------------------

Changed
~~~~~~~

- Use ``pathlib.Path.parents`` instead of sequence of ``pathlib.Path..parent``
to get the parent directory of a file path.
- Type hints and docstrings of some database reader classes are enhanced:
``ApneaECG``, ``CINC2020``, ``CINC2021``.
- Update the ``README`` file: add citation information for the package.

0.0.14

----------------------------------------------------------------------------------------

Added
~~~~~

- Implements the lead-wise mechanism (as a method ``_assign_weights_lead_wise``)
for the ``Conv_Bn_Activation`` layer in the ``torch_ecg.models._nets`` module.
- Implements ``assign_weights_lead_wise`` for model ``MultiScopicCNN``
(in ``torch_ecg.models``).
- Zenodo configuration file ``.zenodo.json`` is added.

Changed
~~~~~~~

- Update the ``README`` file: add ``:point_right: [Back to TOC](torch_ecg)``
to the end of long sections.

Fixed
~~~~~

- Fix errors in the computation of classification metrics.

Page 3 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.