Xception#
- class torch_ecg.models.Xception(in_channels: int, **config)[source]#
Bases:
Sequential,SizeMixin,CitationMixinXception model.
Xception is an architecture that uses depthwise separable convolutions to build light-weight deep neural networks, as described in [1]. Its official implementation is available in [2], and a PyTorch implementation is available in [3]. Xception is currently not widely used in the field of ECG analysis, but has the potential to be highly effective for this task.
- Parameters:
References
- compute_features_output_shape(seq_len: int | None = None, batch_size: int | None = None) Sequence[int | None][source]#
Compute the output shape of the features.
- compute_output_shape(seq_len: int | None = None, batch_size: int | None = None) Sequence[int | None][source]#
Compute the output shape the model.
- forward(input: Tensor) 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:
- forward_features(input: Tensor) Tensor[source]#
Forward pass of the model to extract features.
- Parameters:
input (torch.Tensor) – Input signal tensor, of shape
(batch_size, channels, seq_len).- Returns:
features – Feature map tensor, of shape
(batch_size, channels, seq_len).- Return type: