ECG_SUBTRACT_UNET¶
- class torch_ecg.models.ECG_SUBTRACT_UNET(classes: Sequence[str], n_leads: int, config: Optional[torch_ecg.cfg.CFG] = None)[source]¶
Bases:
torch.nn.modules.module.Module
,torch_ecg.utils.utils_nn.CkptMixin
,torch_ecg.utils.utils_nn.SizeMixin
U-Net for ECG wave delineation.
Entry 0433 of CPSC2019, which is a modification of the U-Net using subtraction instead of addition in branched bottom block.
- Parameters
- compute_output_shape(seq_len: Optional[int] = None, batch_size: Optional[int] = None) Sequence[Optional[int]] [source]¶
Compute the output shape of the model.
- forward(input: torch.Tensor) torch.Tensor [source]¶
Forward pass of the model.
- Parameters
input (torch.Tensor) – Input signal tensor, of shape
(batch_size, n_channels, seq_len)
.- Returns
output – Output tensor, of shape
(batch_size, n_channels, seq_len)
.- Return type
- inference(input: Union[numpy.ndarray, torch.Tensor], bin_pred_thr: float = 0.5) torch.Tensor [source]¶
Method for making inference on a single input.