Diff of /CHANGELOG.rst [000000] .. [d8937e]

Switch to unified view

a b/CHANGELOG.rst
1
Changelog
2
=========
3
4
All notable changes to this project will be documented in this file.
5
6
The format is based on `Keep a
7
Changelog <https://keepachangelog.com/en/1.1.0/>`__, and this project
8
adheres to `Semantic
9
Versioning <https://semver.org/spec/v2.0.0.html>`__.
10
11
`Unreleased <https://github.com/DeepPSP/torch_ecg/compare/v0.0.31...HEAD>`__
12
----------------------------------------------------------------------------
13
14
Added
15
~~~~~
16
17
Changed
18
~~~~~~~
19
20
- Make the function `remove_spikes_naive` in `torch_ecg.utils.utils_signal`
21
  support 2D and 3D input signals.
22
23
Deprecated
24
~~~~~~~~~~
25
26
Removed
27
~~~~~~~
28
29
Fixed
30
~~~~~
31
32
- Correctly update the `_df_metadata` attribute of the `PTBXL` database reader
33
  classes after filtering records.
34
- Enhance the `save` method of the `torch_ecg.utils.utils_nn.CkptMixin` class:
35
  non-safe items in the configs are removed before saving the model.
36
- Fix errors when monitor is specified while the validation dataloader is not
37
  provided in the `torch_ecg.components.BaseTrainer` class.
38
- Enhance the `save_checkpoint` method of the `torch_ecg.components.BaseTrainer` class:
39
  non-safe items in the configs are removed before saving the model.
40
41
Security
42
~~~~~~~~
43
44
`0.0.31 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.30...v0.0.31>`__ - 2025-01-28
45
----------------------------------------------------------------------------------------
46
47
Added
48
~~~~~
49
50
- Add functions for downloading PhysioNet data from AWS S3. It is now made
51
  the default way to download data from PhysioNet.
52
- Add ``easydict`` as a dependency for backward compatibility (loading
53
  old models using safe-mode ``torch.load`` with ``weights_only=True``.
54
  Extra dependencies are added with
55
  ``torch.serialization.add_safe_globals``).
56
57
Changed
58
~~~~~~~
59
60
- Test files (in the ``sample-data`` directory) are updated.
61
- Add keyword argument ``weights_only`` to ``from_checkpoint`` and
62
  ``from_remote`` methods of the models (indeed the ``CkptMixin``
63
  class). The default value is ``"auto"``, which means the behavior is
64
  the same as before. It checks if ``torch.serialization`` has
65
  ``add_safe_globals`` attribute. If it does, it will use safe-mode
66
  ``torch.load`` with ``weights_only=True``. Otherwise, it will use
67
  ``torch.load`` with ``weights_only=False``.
68
69
Deprecated
70
~~~~~~~~~~
71
72
- Support for Python 3.7, 3.8 is deprecated. The minimum supported Python
73
  version is now 3.9. In the ``pyproject.toml`` file, the field
74
  ``requires-python`` is updated from ``>=3.7`` to ``>=3.9``.
75
76
Removed
77
~~~~~~~
78
79
- Restrictions on the version of ``wfdb`` and ``numpy`` packages are
80
  removed.
81
82
Fixed
83
~~~~~
84
85
- Fix IO issues with several PhysioNet databases.
86
87
Security
88
~~~~~~~~
89
90
- Models are now loaded using safe-mode ``torch.load`` with
91
  ``weights_only=True`` by default.
92
93
`0.0.30 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.29...v0.0.30>`__ - 2024-10-10
94
----------------------------------------------------------------------------------------
95
96
Added
97
~~~~~
98
99
- Add support for AWS S3 in the download utility function ``http_get``
100
  in the ``torch_ecg.utils.download`` module. PhysioNet now provides
101
  data download links from AWS S3, and the download utility function
102
  can now handle these links if AWS CLI is installed. This feature is
103
  implemented but not put into use yet.
104
105
Changed
106
~~~~~~~
107
108
- Change the default value of the ``method`` argument of the
109
  ``torch_ecg.utils.utils_signal.resample_irregular_timeseries`` function
110
  from ``"spline"`` to ``"interp1d"``. The former is probably not
111
  correctly implemented.
112
- Update the logger classes: add checking of the write access of the
113
  ``log_dir``. If the directory is not writable, the default log dir
114
  ``~/.cache/torch_ecg/logs`` is used (ref. ``torch_ecg.cfg.DEFAULTS.log_dir``).
115
- Update the selection mechanism of the final model for the trainer
116
  classes: if no monitor is specified, the last model is selected by
117
  default (previously, no model was selected and saved).
118
- The main part of the ``_setup_criterion`` method of the ``BaseTrainer``
119
  class is moved to the function ``setup_criterion`` in the
120
  ``torch_ecg.models.loss`` module. The method is simplified and
121
  enhanced.
122
123
Deprecated
124
~~~~~~~~~~
125
126
- Script ``setup.py`` is deprecated. The package building system is
127
  switched to ``hatch``.
128
129
Removed
130
~~~~~~~
131
132
- Remove redundancy in base trainer classes: identical ``if`` blocks
133
  are removed from the ``_setup_criterion`` method of the ``BaseTrainer``
134
  class.
135
136
Fixed
137
~~~~~
138
139
- Fix potential error in getting model name in the trainer classes.
140
- Fix bugs in the ``CINC2020`` and ``CINC2021`` database reader classes
141
  for parsing the header files.
142
143
`0.0.29 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.28...v0.0.29>`__ - 2024-07-21
144
----------------------------------------------------------------------------------------
145
146
Added
147
~~~~~
148
149
- Add keyword argument ``with_suffix`` to function
150
  ``torch_ecg.utils.misc.get_record_list_recursive3``.
151
- Add function ``_download_from_google_drive`` to the
152
  ``torch_ecg.utils.download`` module for downloading files from Google
153
  Drive.
154
- Add ``gdown`` as a dependency in the ``requirements.txt`` file.
155
- Add database reader class ``PTBXLPlus`` for the PTB-XL+ database in
156
  ``torch_ecg.databases.physionet_databases``.
157
- Add github-release job to the publish action for creating a release
158
  on GitHub automatically.
159
160
Changed
161
~~~~~~~
162
163
- Improve the main training loop method of the base trainer class
164
  ``torch_ecg.components.trainers.BaseTrainer``.
165
- Allow passing additional keyword arguments to pass to ``requests.head``
166
  in the ``url_is_reachable`` function of the ``torch_ecg.utils.download``
167
  module (via adding the ``**kwargs`` argument).
168
- Restrict version of ``numpy`` to be ``<=2.0.0`` in the
169
  ``requirements.txt`` file. ``numpy`` version ``2.0.0`` is a breaking
170
  update, and a large proportion of the dependencies of this project
171
  are not compatible with it yet.
172
- Enhance the ``cls_to_bin`` function and rename it to ``one_hot_encode``
173
  in the ``torch_ecg.utils.utils_data`` module.
174
175
Fixed
176
~~~~~
177
178
- Enhance compatibility for different ``pandas`` versions.
179
- Fix errors for taking length of an empty database reader class.
180
181
Security
182
~~~~~~~~
183
184
- Fix code scanning alert - Incomplete regular expression for hostnames
185
  `#21 <https://github.com/DeepPSP/torch_ecg/pull/21>`__.
186
- Fix code scanning alert - Incomplete URL substring sanitization
187
  `#23 <https://github.com/DeepPSP/torch_ecg/pull/23>`__.
188
189
`0.0.28 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.27...v0.0.28>`__ - 2024-04-02
190
----------------------------------------------------------------------------------------
191
192
Added
193
~~~~~
194
195
- Add CD workflow for the publish action with GitHub Action.
196
- Add an optional argument ``return_fs`` for the ``load_data``
197
  method for the database reader classes. If ``True``, the sampling
198
  frequency of the record is returned along with the data as a tuple.
199
  To keep the behavior consistent, the default value is ``False``.
200
- Add an optional parameter ``fs`` for the function ``compute_receptive_field``
201
  in the ``torch_ecg.utils.utils_nn`` module. If ``fs`` is provided, the
202
  receptive field is computed based on the sampling frequency.
203
- Add method ``compute_receptive_field`` for several convolutional neural
204
  network models (layers) in the ``torch_ecg.models._nets`` module.
205
- Add helper function ``make_serializable`` in the ``torch_ecg.utils.misc``
206
  module for making an object serializable (with the ``json`` package).
207
  It will convert all ``numpy`` arrays to ``list`` in an object, and
208
  also convert ``numpy`` data types to python data types in the object
209
  recursively.
210
- Add helper function ``url_is_reachable`` in the ``torch_ecg.utils.download``
211
  module for checking if a URL is reachable.
212
- Add database reader class ``PTBXL`` for the PTB-XL database in
213
  ``torch_ecg.databases.physionet_databases``.
214
- Add class method ``from_remote`` for ``CkptMixin`` classes. It is used
215
  to load a model from a remote location (e.g., a URL) directly.
216
- Add ``sphinx-emoji-favicon`` as a dependency for generating the favicon
217
  for the documentation.
218
- Add utility function ``ecg_plot`` from
219
  `ecg-image-kit <https://github.com/alphanumericslab/ecg-image-kit/.>`__.
220
- Add ``pyarrow`` as a dependency in the ``requirements.txt`` file.
221
- Add benchmark study ``train_crnn_cinc2023`` for the CinC2023 challenge.
222
223
Changed
224
~~~~~~~
225
226
- Change the default value ``reset_index`` of the utility function
227
  ``torch_ecg.utils.utils_data.stratified_train_test_split`` from
228
  ``True`` to ``False``.
229
- Enhance the decorator ``torch_ecg.utils.misc.add_kwargs`` so that
230
  the signature of the decorated function is also updated.
231
- Update the documentation: use ``sphinx_toolbox.collapse`` and
232
  ``sphinxcontrib.bibtex``; add citation info in the index page.
233
- Make ``Dataset`` classes accept slice index for the ``__getitem__``
234
  method.
235
236
Deprecated
237
~~~~~~~~~~
238
239
- Support for Python 3.6 is deprecated. The minimum supported Python
240
  version is updated to 3.7.
241
242
Removed
243
~~~~~~~
244
245
- Remove broken links in the docstrings of the database reader classes.
246
- Remove unused scripts ``formatting.sh`` and ``push2pypi.sh``.
247
248
Fixed
249
~~~~~
250
251
- Fix errors in the decorator ``torch_ecg.utils.misc.add_kwargs``
252
  when a bound method is decorated.
253
- Fix bugs related to data overflow for preprocessor classes that
254
  work with ``numpy`` arrays as reported in issue
255
  `#12 <https://github.com/DeepPSP/torch_ecg/issues/12>`__.
256
- Fix bugs in augmentor class ``StretchCompress`` in the
257
  ``torch_ecg.augmenters`` module.
258
- Fix dtype error when calling ``compute_class_weight`` from
259
  ``sklearn.utils``.
260
- Fix the issue when handling nan values in in computing metrics.
261
- Fix errors for the ``ApneaECG`` database reader class when passing
262
  a path that does not exist or a path that contains no records at
263
  initialization.
264
265
`0.0.27 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.26...v0.0.27>`__ - 2023-03-14
266
----------------------------------------------------------------------------------------
267
268
Added
269
~~~~~
270
271
- Add default configs for blocks of the ``ResNet`` model in the
272
  ``torch_ecg.models.cnn`` module.
273
- Add ``RegNet`` model in the ``torch_ecg.models.cnn`` module.
274
- Add ``CutMix`` augmentor in the ``torch_ecg.augmenters`` module.
275
- Add support for ``torch.nn.Dropout1d`` in the models.
276
- Add ``.readthedocs.yml`` to the project. The documentation is
277
  now hosted on Read the Docs besides GitHub Pages.
278
279
Changed
280
~~~~~~~
281
282
- Move ``torch_ecg.utils.preproc`` to ``torch_ecg.utils._preproc``.
283
- Allow ``embed_dim`` of ``SelfAttention`` layer not divisible by
284
  ``num_heads`` via adding a linear projection layer before the
285
  multi-head attention layer.
286
- Documentation is largely improved.
287
288
Deprecated
289
~~~~~~~~~~
290
291
- Drop compability for older versions of ``torch`` (1.5 and below).
292
293
Removed
294
~~~~~~~
295
296
- Remove ``protobuf`` from the ``requirements.txt`` file.
297
- Clear unused methods in the ``CINC2020`` and ``CINC2021`` database
298
  reader classes.
299
- Clear unused layers in the ``torch_ecg.models._nets`` module.
300
- Remove the ``torch_ecg.utils._pantompkins`` module. It contains
301
  the implementation of the Pan-Tompkins algorithm for QRS detection,
302
  modified from old versions of the ``wfdb`` package. It is moved to
303
  the ``legacy`` folder of the project.
304
- Remove ``WandbLogger`` class from the ``torch_ecg.components.loggers``
305
  module.
306
307
Fixed
308
~~~~~
309
310
- Fix bugs when passing ``units=None`` for the ``load_data`` method
311
  of the PhysioNet database reader classes.
312
313
`0.0.26 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.25...v0.0.26>`__ - 2022-12-25
314
----------------------------------------------------------------------------------------
315
316
Added
317
~~~~~
318
319
- Add a default ``load_data`` method for physionet databases reader
320
  classes in the base class ``PhysioNetDataBase``. In most cases,
321
  in the inherited classes, one does not need to implement the
322
  ``load_data`` method, as the default method is sufficient. This
323
  method is a slight improvement over ``wfdb.rdrecord``.
324
- Add decorator ``add_kwargs`` in the ``torch_ecg.utils.misc`` module
325
  for adding keyword arguments to a function or method.
326
- Add functions ``list_databases``, ``list_datasets`` in the
327
  ``torch_ecg.datasets`` module for listing available databases reader
328
  classes and ``Dataset`` classes.
329
- Add ``save`` method for the ``CkptMixin`` class. It is used to save
330
  the model to a file.
331
- Add ``_normalize_leads`` a method of the base ``_DataBase`` class
332
  in the ``torch_ecg.databases.base`` module. It is used to normalize
333
  the names of the ECG leads.
334
- Add subsampling functionality for database reader classes.
335
- Add benchmark study ``train_mtl_cinc2022`` for the CinC2022 challenge.
336
- Add ``CITATIONS.bib`` file for storing BibTeX entries of the
337
  papers related to the project.
338
- Add 10 sample data from the CPSC2018 database for testing in the
339
  ``sample-data`` directory.
340
341
Changed
342
~~~~~~~
343
344
- Use ``CitationMixin`` from the ``bib-lookup`` package as the base
345
  class for the ``DataBaseInfo`` class in ``torch_ecg.databases.base``.
346
- Use ``CitationMixin`` as one of the base classes for the models
347
  in ``torch_ecg.models``.
348
- Allow dummy (empty) preprocessor managers, a warning instead of an
349
  error is raised in such cases.
350
- Enhance error message for the computation of metrics.
351
- Add keyword argument ``requires_grad`` and ``include_buffers`` to
352
  the ``torch_ecg.utils.utils_nn.compute_module_size`` function.
353
  The ``dtype`` argument is removed as the data type of the model
354
  is now inferred from the model itself.
355
- Improve several database reader classes: ``CPSC2018``, ``CPSC2021``,
356
  ``CINC2017``, ``ApneaECG``, ``MITDB``, ``SPH``.
357
- Add asymmetric zero pad for convolution layers, so that when
358
  ``stride = 1`` and ``kernel_size`` is even, strict ``"same"``
359
  padding is conducted.
360
- Use loggers instead of ``print`` in database reader classes.
361
- Integrate code coverage into the CI workflow. The coverage report
362
  is generated and uploaded to Codecov.
363
- More unit tests are added, and the existing ones are updated.
364
  Code coverage is largely improved.
365
366
Deprecated
367
~~~~~~~~~~
368
369
- Drop compatibility for ``tqdm`` < 4.29.1
370
371
Removed
372
~~~~~~~
373
374
- Remove unused rpeaks detection methods in the ``torch_ecg.utils.rpeaks``
375
  module.
376
- Remove ``_normalize_leads`` method in ``LUDB`` database reader class.
377
- Remove unused functions in the file of the ``CPSC2020`` database reader
378
  class.
379
380
Fixed
381
~~~~~
382
383
- Fix bugs in the config class ``torch_ecg.cfg.CFG``.
384
- Fix errors in the ``plot`` method of ``CINC2020`` and ``CINC2021``
385
  database reader classes.
386
387
Security
388
~~~~~~~~
389
390
- `CVE-2007-4559 <https://github.com/advisories/GHSA-gw9q-c7gh-j9vm>`__
391
  patch: Fix a potential security vulnerability in the
392
  ``torch_ecg.utils.download.http_get`` function.
393
394
`0.0.25 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.23...v0.0.25>`__ - 2022-10-08
395
----------------------------------------------------------------------------------------
396
397
Added
398
~~~~~
399
400
- Add docstring utility function ``remove_parameters_returns_from_docstring``
401
  in ``torch_ecg.utils.misc``.
402
- Add abstract property ``database_info`` to the base class ``_DataBase`` in
403
  ``torch_ecg.databases.base`` so that when implementing a new database reader
404
  class that inherits from the base class, its ``DataBaseInfo`` must be
405
  implemented and assigned to the property.
406
- Add method ``get_citation`` to the base abstract class ``_DataBase`` in
407
  ``torch_ecg.databases.base`` which enhances the process for getting citations
408
  for the databases.
409
- Add database reader class ``CACHET_CADB`` for the CACHET-CADB database in
410
  ``torch_ecg.databases.other_databases``.
411
- Add ``download`` method for the base abstract class ``CPSCDataBase`` in
412
  ``torch_ecg.databases.base``.
413
414
Changed
415
~~~~~~~
416
417
- Improve the warning message for passing an non-existing path when
418
  initializing a database reader class.
419
- Change the default behavior of the ``download`` method for
420
  ``PhysioNetDataBase`` class: default to download the compressed
421
  version of the database.
422
- Update the ``README`` file in the ``torch_ecg/databases`` directory.
423
424
Fixed
425
~~~~~
426
427
- Use ``register_buffer`` in custom loss classes for constant tensors
428
  to avoid potential device mismatch issues.
429
- Rename and update the data file ``physionet_dbs.csv.tar.gz`` to
430
  ``physionet_dbs.csv.gz`` to comply with the changement of the
431
  ``pandas.read_csv`` function from version 1.4.x to 1.5.x.
432
- Fix the incorrect usage of ``NoReturn`` type hints. It is replaced
433
  with ``None`` to indicate that the function/method does not return
434
  anything.
435
436
0.0.24 - 2022-08-13 [YANKED]
437
-----------------------------
438
439
This release was yanked.
440
441
`0.0.23 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.22...v0.0.23>`__ - 2022-08-09
442
----------------------------------------------------------------------------------------
443
444
Added
445
~~~~~
446
447
- Add ``collate_fn`` as an optional argument for ``BaseTrainer`` class
448
  in ``torch_ecg.components.trainers``.
449
450
Changed
451
~~~~~~~
452
453
- Let ``db_dir`` attribute of the database reader classes be absolute
454
  when instantiated, to avoid potential ``pathlib`` errors.
455
- Update utility function `torch_ecg.utils.utils_nn.adjust_cnn_filter_lengths``:
456
  avoid assigning unnecessary fs to dict-type config items; change default
457
  value of the ``pattern`` argument from ``"filter_length|filt_size"`` to
458
  ``"filter_length|filter_size"`` to avoid unintended changement of configs
459
  for ``BlurPool`` (in ``torch_ecg.models._nets``).
460
- Enhance error message for ``BlurPool`` in ``torch_ecg.models._nets``.
461
462
`0.0.22 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.21...v0.0.22>`__ - 2022-08-05
463
----------------------------------------------------------------------------------------
464
465
Changed
466
~~~~~~~
467
468
- Make utility function ``torch_ecg.utils.utils_data.default_collate_fn``
469
  support ``dict`` type batched data.
470
- Update docstrings of several metrics utility functions in
471
  ``torch_ecg.utils.utils_metrics``.
472
473
`0.0.21 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.20...v0.0.21>`__ - 2022-08-01
474
----------------------------------------------------------------------------------------
475
476
Added
477
~~~~~
478
479
- Add utility function ``get_kwargs`` in ``torch_ecg.utils.misc`` for
480
  getting (keyword) arguments from a function/method.
481
- Add AHA diagnosis statements in ``torch_ecg.databases.aux_data``.
482
- Add argument ``reset_index`` to the utility function
483
  ``torch_ecg.utils.utils_data.stratified_train_test_split``.
484
- Add ``typing-extensions`` as a dependency in the ``requirements.txt``
485
  file.
486
- Add database reader class ``QTDB`` for the QTDB database in
487
  ``torch_ecg.databases.physionet_databases``.
488
489
Changed
490
~~~~~~~
491
492
- Enhance data handling (typicall when using the ``load_data`` method of
493
  the database reader classes) with precise dtypes via
494
  ``torch_ecg.cfg.DEFAUTLS``.
495
- Update the setup of optimizer for the base trainer class
496
  ``torch_ecg.components.trainers.BaseTrainer``.
497
- Update the ``DataBaseInfo`` class for the ``SPH`` database.
498
- Update the ``README`` file in the ``torch_ecg/databases`` directory.
499
- Update plotted figures of the benchmark studies.
500
- Rename ``SequenceLabelingOutput`` to ``SequenceLabellingOutput``
501
  (typo fixed) in the ``torch_ecg.components.outputs`` module.
502
- Enhance docstring of ``LUDB`` database reader class via updating its
503
  ``DataBaseInfo`` class.
504
- Append the ``_ls_rec`` method as the last step in the ``download``
505
  method of the database reader classes.
506
- Change ``torch_ecg.utils.utils_data.ECGWaveForm`` from a ``namedtuple``
507
  to a ``dataclass``.
508
509
Removed
510
~~~~~~~
511
512
- ``bib_lookup.py`` is removed from the project. It is now delivered in
513
  an isolated package ``bib_lookup`` published on PyPI, and added as a
514
  dependency in the ``requirements.txt`` file.
515
- Remove unnecessary script ``exec_git.py``.
516
- Remove ``joblib`` in the ``requirements.txt`` file.
517
518
`0.0.20 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.19...v0.0.20>`__ - 2022-06-15
519
----------------------------------------------------------------------------------------
520
521
Added
522
~~~~~
523
524
- Add database reader class ``SPH`` for the SPH database in
525
  ``torch_ecg.databases.other_databases``.
526
- Add ``dataclass`` ``DataBaseInfo`` for storing information of a
527
  database. It has attributes ``title``, ``about``, ``note``,
528
  ``usage``, ``issues``, ``reference``, etc., and has a method
529
  ``format_database_docstring`` for formatting the docstring of a
530
  database reader class. The generated docstring can be assigned to
531
  corresponding database reader class via the ``add_docstring``
532
  decorator (in ``torch_ecg.utils.misc``).
533
- Add default cache directory ``~/.cache/torch_ecg`` for storing
534
  downloaded data files, model weight files, etc.
535
- Add helper function ``is_compressed_file`` for checking if a file is
536
  compressed in ``torch_ecg.utils.download``.
537
538
`0.0.19 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.18...v0.0.19>`__ - 2022-06-09
539
----------------------------------------------------------------------------------------
540
541
Added
542
~~~~~
543
544
- Add argument ``relative`` to the utility function ``get_record_list_recursive3``.
545
- Add attribute ``_df_records`` to the database reader classes. The attribute
546
  stores the DataFrame of the records of the database, containing paths to the
547
  records and other information (labels, demographics, etc.).
548
549
Fixed
550
~~~~~
551
552
- Fix bugs in the download utility function ``http_get``.
553
- Fix bugs in the database reader classe ``CPSC2021``.
554
555
`0.0.18 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.16...v0.0.18>`__ - 2022-06-05
556
----------------------------------------------------------------------------------------
557
558
Added
559
~~~~~
560
561
- Add property ``in_channels`` for the models.The number of input channels
562
  is stored as a private attribute ``_in_channels``, and the property
563
  ``in_channels`` makes it easier to access the value.
564
- Add warning message to the ``download`` method of the ``CPSC2019`` database
565
  reader class.
566
- Add ``get_absolute_path`` method for the database reader classes to
567
  uniformly handle the path operations.
568
569
Changed
570
~~~~~~~
571
572
- All all absolute imports are replaced with relative imports.
573
- Update citation and images for several benchmark studies
574
- Update the ``downlaod`` link for the ``CPSC2019`` database reader class
575
  (ref. property ``torch_ecg.databases.CPSC2019.url``).
576
577
Removed
578
~~~~~~~
579
580
- Remove the ``torch_ecg.utils.misc.deprecate_kwargs`` decorator. It is
581
  delivered in an isolated package ``deprecate_kwargs`` published on PyPI,
582
  and added as a dependency in the ``requirements.txt`` file.
583
584
Fixed
585
~~~~~
586
587
- Fix errors in the ``_ls_rec`` method of the ``CPSC2019`` database reader
588
  class.
589
- Fix bugs in the ``torch_ecg.utils.misc.deprecate_kwargs`` decorator.
590
- Fix the issue that ``tensorboardX`` is incompatible with the latest version
591
  of ``protobuf``.
592
593
0.0.17 - 2022-05-03 [YANKED]
594
-----------------------------
595
596
This release was yanked.
597
598
`0.0.16 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.15...v0.0.16>`__ - 2022-04-28
599
----------------------------------------------------------------------------------------
600
601
Added
602
~~~~~
603
604
- Add method ``_categorize_records`` for the ``MITDB`` database reader class,
605
  categorize records by specific attributes. Related helper properties
606
  ``beat_types_records`` and ``rhythm_types_records`` are added.
607
- Add method ``_aggregate_stats`` for the ``MITDB`` database reader class.
608
  Related helper properties ``df_stats`` and ``db_stats`` are added.
609
- Add  function ``cls_to_bin`` for converting categorical (typically multi-label)
610
  class labels to binary class labels (2D array with 0/1 values).
611
- Add context manager ``torch_ecg.utils.misc.timeout`` for setting a timeout for
612
  a block of code.
613
- Add context manager ``torch_ecg.utils.misc.Timer`` to time the execution of
614
  a block of code.
615
- Add module ``torch_ecg.components.inputs`` for input data classes.
616
- Add class ``Spectrogram`` (in ``torch_ecg.utils``) for generating spectrogram
617
  input data. This class is modified from the ``torchaudio.transforms.Spectrogram``.
618
- Add decorator ``torch_ecg.utils.misc.deprecate_kwargs`` for deprecating keyword
619
  arguments of a function/method.
620
- Top-level module ``torch_ecg.ssl`` for self-supervised learning methods and
621
  models is introduced, but not implemented yet.
622
- Add helper function ``torch_ecg.utils.utils_nn.compute_sequential_output_shape``
623
  to simplify the computation of output shape of sequential models.
624
- ``mobilenet_v3`` model is added to the ``torch_ecg.models`` module. It is
625
  now available as a cnn backbone choice for the ``ECG_CRNN`` model (and for other
626
  downstream task models).
627
628
Changed
629
~~~~~~~
630
631
- Use ``numpy``'s default ``rng`` for random number generation in place
632
  of ``np.random`` and Python built-in ``random`` module.
633
- Update the ``README`` file.
634
- Move the function ``generate_weight_mask`` from ``CPSC2021`` dataset
635
  to ``torch_ecg.utils.utils_data``.
636
- Database reader ``MITDB`` is enhanced: add properties ``df_stats_expanded``;
637
  add arguments ``beat_types`` and ``rhythm_types`` to the data and annotation
638
  loading methods.
639
- Downloading function ``http_get`` is enhanced to support downloading
640
  normal files other than compressed files.
641
- Update ``__init__`` file of the ``torch_ecg.utils`` module.
642
- Database reader class ``CinC2017`` is updated: add property ``_validation_set``.
643
- The ``ECG_UNET`` model is simplified by removing the unnecessary zero padding
644
  along the channel axis.
645
- Update the ``README`` file.
646
647
Deprecated
648
~~~~~~~~~~
649
650
- Keyword argument ``batch_norm`` in model building blocks (ref. ``torch_ecg.models``)
651
  is deprecated. Use ``norm`` instead.
652
653
Removed
654
~~~~~~~
655
656
- Redundant functions in ``torch_ecg.utils.utils_interval`` are removed:
657
  ``diff_with_step``, ``mask_to_intervals``.
658
659
Fixed
660
~~~~~
661
662
- Remove redudant code for the ``ECG_UNET`` model which might cause error in
663
  computing output shapes.
664
665
`0.0.15 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.14...v0.0.15>`__ - 2022-04-14
666
----------------------------------------------------------------------------------------
667
668
Changed
669
~~~~~~~
670
671
- Use ``pathlib.Path.parents`` instead of sequence of ``pathlib.Path..parent``
672
  to get the parent directory of a file path.
673
- Type hints and docstrings of some database reader classes are enhanced:
674
  ``ApneaECG``, ``CINC2020``, ``CINC2021``.
675
- Update the ``README`` file: add citation information for the package.
676
677
`0.0.14 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.13...v0.0.14>`__ - 2022-04-10
678
----------------------------------------------------------------------------------------
679
680
Added
681
~~~~~
682
683
- Implements the lead-wise mechanism (as a method ``_assign_weights_lead_wise``)
684
  for the ``Conv_Bn_Activation`` layer in the ``torch_ecg.models._nets`` module.
685
- Implements ``assign_weights_lead_wise`` for model ``MultiScopicCNN``
686
  (in ``torch_ecg.models``).
687
- Zenodo configuration file ``.zenodo.json`` is added.
688
689
Changed
690
~~~~~~~
691
692
- Update the ``README`` file: add ``:point_right: [Back to TOC](#torch_ecg)``
693
  to the end of long sections.
694
695
Fixed
696
~~~~~
697
698
- Fix errors in the computation of classification metrics.
699
700
`0.0.13 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.12...v0.0.13>`__ - 2022-04-09
701
----------------------------------------------------------------------------------------
702
703
Added
704
~~~~~
705
706
- Add metrics computation class ``WaveDelineationMetrics`` for evaluating the
707
  performance of ECG wave delineation models.
708
- Add methods for computing the metrics to the output classes (in the module
709
  ``torch_ecg.components.outputs``).
710
- Add script ``push2pypi.sh`` for pushing the package to PyPI.
711
- Add attribute ``global_pool_size`` to the configuration of the classification
712
  models (``torch_ecg.models.ECG_CRNN``).
713
714
Changed
715
~~~~~~~
716
717
- ``flake8`` check ignore list is updated.
718
- ``README`` is updated.
719
720
Removed
721
~~~~~~~
722
723
- Usage of ``easydict`` is removed. Now we use ``torch_ecg.cfg.CFG`` for
724
  configuration.
725
726
Fixed
727
~~~~~
728
729
- Computation of the metric of `mean_error` for ECG wave delineation is corrected.
730
- Fix bugs in ``SpaceToDepth`` layer (``torch_ecg.models.resnet``).
731
732
`0.0.12 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.11...v0.0.12>`__ - 2022-04-05
733
----------------------------------------------------------------------------------------
734
735
Changed
736
~~~~~~~
737
738
- Some out-of-date ``sample-data`` files are updated, unnecessary files
739
  are removed.
740
- Passing a path that does not exist to a database reader class now raises
741
  no error, but a warning is issued instead.
742
- Include ``isort`` and ``flake8`` in the code formatting and linting steps.
743
  Code are reformatted and linted.
744
745
`0.0.11 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.10...v0.0.11>`__ - 2022-04-03
746
----------------------------------------------------------------------------------------
747
748
Changed
749
~~~~~~~
750
751
- Docstrings are cleaned up.
752
- Unit tests are updated.
753
754
`0.0.10 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.9...v0.0.10>`__ - 2022-04-01
755
----------------------------------------------------------------------------------------
756
757
Added
758
~~~~~
759
760
- Add ``BibLookup`` class for looking up BibTeX entries from DOIs
761
  of papers related to datasets and models.
762
- Add ``RPeaksDetectionMetrics`` class to the ``torch_ecg.components.metrics``
763
  module for evaluating the performance of R-peaks detection models.
764
- Add CI workflow for running tests via GitHub Actions.
765
766
Changed
767
~~~~~~~
768
769
- The loading methods (``load_data``, ``load_ann``, etc.) of the database
770
  reader classes are enhanced to accept ``int`` type record name argument
771
  (``rec``), which redirects to the record with the corresponding index
772
  in the ``all_records`` attribute of the database reader class.
773
774
`0.0.9 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.8...v0.0.9>`__ - 2023-03-30
775
----------------------------------------------------------------------------------------
776
777
Added
778
~~~~~
779
780
- Add decorator ``add_docstring`` for adding/modifying docstrings of functions
781
  and classes.
782
- Add method ``append`` for the ``BaseOutput`` class.
783
- Add several metrics computation functions in ``torch_ecg/utils/utils_metrics.py``:
784
   - ``confusion_matrix``
785
   - ``ovr_confusion_matrix``
786
   - ``auc``
787
   - ``accuracy``
788
   - ``f_measure``
789
   - ``QRS_score``
790
- Add top-level module ``torch_ecg.components``.
791
- Add classes for metrics computation to the ``torch_ecg.components.metrics`` module.
792
793
Changed
794
~~~~~~~
795
796
- ``Dataset`` classes and corresponding config classes are added to the
797
  ``__init__.py`` file of the ``torch_ecg.databases.dataset`` module
798
  so that they can be imported directly from the module.
799
- Logger classes, output classes, and trainer classes are moved to the new
800
  module ``torch_ecg.components``.
801
- Callbacks in ``BaseTrainer`` are enhanced, allowing empty monitor, and allowing
802
  non-positive number of checkpoints to be saved (i.e., no checkpoint is saved).
803
804
`0.0.8 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.7...v0.0.8>`__ - 2022-03-29
805
----------------------------------------------------------------------------------------
806
807
Fixed
808
~~~~~
809
810
- Bugs in extracting compressed files in the ``http_get`` function
811
  of the ``utils.download`` module.
812
813
Security
814
~~~~~~~~
815
816
`0.0.7 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.6...v0.0.7>`__ - 2022-03-28
817
----------------------------------------------------------------------------------------
818
819
Fixed
820
~~~~~
821
822
- Import errors for early versions of pytorch.
823
- Cached table of PhysioNet databases is added as ``package_data`` in
824
  ``setup.py`` to avoid the error of missing the table file when
825
  installing the package.
826
827
Security
828
~~~~~~~~
829
830
`0.0.6 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.5...v0.0.6>`__ - 2022-03-28
831
----------------------------------------------------------------------------------------
832
833
Added
834
~~~~~
835
836
- Add methods ``__len__`` and ``__getitem__`` for the base class
837
  ``torch_ecg.databases.base._DataBase``.
838
839
Changed
840
~~~~~~~
841
842
- The base class of ``CPSC2021`` is changed from ``CPSCDataBase`` to
843
  ``PhysioNetDataBase``.
844
- Function ``compute_output_shape`` is enhanced to support different
845
  paddings in two ends of the input signal.
846
- ``README`` is updated.
847
- Docstrings of many classes and functions are updated.
848
- ``black`` is used for code formatting.
849
850
`0.0.5 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.4...v0.0.5>`__ - 2022-03-27
851
----------------------------------------------------------------------------------------
852
853
Added
854
~~~~~
855
856
- Add cached table of PhysioNet databases as a data file
857
  stored in the package.
858
- Add ``requests`` as a dependency in the ``requirements.txt`` file.
859
860
Changed
861
~~~~~~~
862
863
- An optional argument ``btype`` is added to the function
864
  ``butter_bandpass_filter`` to specify the type of the filter:
865
  ``"lohi"``, ``"hilo"``.
866
- A ``compressed`` argument is added to the ``download`` method of the
867
  ``PhysioNetDataBase`` class to specify whether to download the
868
  compressed version of the database.
869
870
Fixed
871
~~~~~
872
873
- Fix bugs in the function ``preprocess_multi_lead_signal``.
874
875
`0.0.4 <https://github.com/DeepPSP/torch_ecg/compare/v0.0.2...v0.0.4>`__ - 2022-03-26
876
----------------------------------------------------------------------------------------
877
878
Added
879
~~~~~
880
881
- Add ``ReprMixin`` class for better representation of the classes
882
  (e.g., models, preprocessors, database readers, etc.).
883
- Added model_dir to default config.
884
- Add ``Dataset`` classes for generating input data for the models:
885
   - ``CINC2020``
886
   - ``CINC2021``
887
   - ``CPSC2019``
888
   - ``CPSC2021``
889
   - ``LUDB``
890
- Add ``sample-data`` directory for storing sample data for testing.
891
- Add ``url`` property to the database classes.
892
- Add utility functions for the computation of metrics.
893
- Add ``BeatAnn`` class for better annotation of ECG beats.
894
- Add download utility functions.
895
- Add ``Output`` classes for the models. The output classes are used to
896
  store the output of the models and provide methods for post-processing.
897
898
Changed
899
~~~~~~~
900
901
- Manipulation of custom preprocessor classes is enhanced.
902
- ``SizeMixin`` class is improved for better computation of the sizes of the models.
903
- Replace ``os`` with ``pathlib``, which is more flexible for path operations.
904
- Several database reader classes are updated: mitdb, ltafdb.
905
- Improve ``PhysioNetDataBase`` by using wfdb built-in methods of
906
  getting database version string and downloading the database.
907
- Update the ``README`` file.
908
909
Removed
910
~~~~~~~
911
912
- Unnecessary imports are removed.
913
914
Fixed
915
~~~~~
916
917
- Fix bugs in the ``flush`` method of the ``TxtLogger``.
918
919
0.0.3 - 2022-03-24 [YANKED]
920
-----------------------------
921
922
This release was yanked.
923
924
`0.0.2 <https://github.com/DeepPSP/torch_ecg/releases/tag/v0.0.2>`__ - 2022-03-04
925
----------------------------------------------------------------------------------------
926
927
Added
928
~~~~~
929
930
- Add ``Preprocessor`` classes for ECG data preprocessing (ref.
931
  ``torch_ecg.preprocessors``).
932
- Add ``Augmenter`` classes for ECG data augmentation (ref.
933
  ``torch_ecg.augmenters``).
934
- Add database reader classes for reading ECG data from different
935
  sources (ref. ``torch_ecg.databases``).
936
- Add model classes for ECG signal analysis, including classification,
937
  segmentation (R-peak detection, wave delineation, etc., ref.
938
  ``torch_ecg.models``).
939
- Add several benchmark studies for ECG signal analysis tasks:
940
941
   - CinC2020, multi-label classification.
942
   - CinC2021, multi-label classification.
943
   - CPSC2019, QRS detection.
944
   - CPSC2020, single-label classification.
945
   - CPSC2021, single-label classification.
946
   - LUDB, wave delineation.
947
948
  ref. the ``benchmarks`` directory of the project.
949
- Add documentation for the project (ref. ``docs`` directory).
950
- Add CodeQL action for security analysis (ref. ``.github/workflows``).
951
- Add unit tests for the project (ref. ``test`` directory).
952
953
0.0.1 - 2022-03-03 [YANKED]
954
-----------------------------
955
956
This release was yanked.