Concatenate¶
- class torcheeg.transforms.Concatenate(transforms: Sequence[Callable], axis: int = -1, apply_to_baseline: bool = False)[source][source]¶
Merge the calculation results of multiple transforms, which are used when feature fusion is required.
from torcheeg import transforms t = transforms.Concatenate([ transforms.BandDifferentialEntropy(), transforms.BandMeanAbsoluteDeviation() ]) t(eeg=np.random.randn(32, 128))['eeg'].shape >>> (32, 8)
- Parameters:
transforms (list, tuple) – a sequence of transforms.
axis (int) – The axis along which the arrays will be joined. If axis is None, arrays are flattened before use (default:
-1
).apply_to_baseline – (bool): Whether to act on the baseline signal at the same time, if the baseline is passed in when calling. (default:
False
)
- __call__(*args, **kwargs) Dict[str, ndarray] [source][source]¶
- Parameters:
eeg (np.ndarray) – The input EEG signals in shape of [number of electrodes, number of data points].
baseline (np.ndarray, optional) – The corresponding baseline signal, if apply_to_baseline is set to True and baseline is passed, the baseline signal will be transformed with the same way as the experimental signal.
- Returns:
The combined results of multiple transforms.
- Return type:
np.ndarray