torcheeg.transforms¶
Datatype-independent Transforms¶
Compose several transforms together. |
|
Apply a user-defined lambda as a transform. |
|
A transform method to subtract the baseline signal (the signal recorded before the emotional stimulus), the nosie signal is removed from the emotional signal unrelated to the emotional stimulus. |
Numpy-based Transforms¶
A transform method to convert EEG signals of each channel into spectrograms using wavelet transform. |
|
A transform method to split the EEG signal into signals in different sub-bands. |
|
A transform method for calculating the differential entropy of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the power spectral density of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the mean absolute deviation of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the kurtosis of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the skewness of EEG signals in several sub-bands with EEG signals as input. |
|
Splitting the EEG signal from each electrode into two functions using wavelet decomposition. |
|
A transform method for calculating the approximate entropy of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the sample entropy of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the SVD entropy of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the detrended fluctuation analysis (DFA) of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the petrosian fractal dimension (PFD) of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the higuchi fractal dimension (HFD) of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the hjorth mobility/complexity of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the hurst exponent of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method for calculating the power of EEG signals in several sub-bands with EEG signals as input. |
|
Calculate autoregression reflection coefficients on the input data. |
|
A transform method for calculating the spectral entropy of EEG signals in several sub-bands with EEG signals as input. |
|
A transform method to calculate the correlation coefficients between the EEG signals of different electrodes. |
|
A transform method to calculate the phase locking values between the EEG signals of different electrodes. |
|
Perform z-score normalization on the input data. |
|
Perform min-max normalization on the input data. |
|
Select parts of electrode signals based on a given electrode index list. |
|
Taking the electrode index as the row index and the temporal index as the column index, a two-dimensional EEG signal representation with the size of [number of electrodes, number of data points] is formed. |
|
A transform method to project the EEG signals of different channels onto the grid according to the electrode positions to form a 3D EEG signal representation with the size of [number of data points, width of grid, height of grid]. |
|
A transform method to project the EEG signals of different channels onto the grid according to the electrode positions to form a 3D EEG signal representation with the size of [number of data points, width of grid, height of grid]. |
|
Merge the calculation results of multiple transforms, which are used when feature fusion is required. |
|
Divide the input EEG signal into multiple chunks according to chunk_size and overlap, and then apply a transofrm to each chunk, and combine the calculation results of a transofrm on all chunks. |
|
Downsample the EEG signal to a specified number of data points. |
|
Select parts of electrode signals based on a given electrode index list. |
|
Flatten the input EEG representation. |
PyG-based Transforms¶
A transformation method for constructing a graph representation of EEG signals, the results of which are applied to the input of the |
|
A transformation method for dynamically constructing the functional connections between electrodes according to the input EEG signals. |
Torch-based Transforms¶
Convert a |
|
Use an interpolation algorithm to scale a grid-like EEG signal at the spatial dimension. |
|
Add random noise conforming to the normal distribution on the EEG signal. |
|
Overlay the EEG signal using a random mask, and the value of the overlaid data points was set to 0.0. |
|
Randomly applies a slice transformation with a given probability, where the original time series is sliced by a window, and the sliced data is scaled to the original size. |
|
Apply the window warping with a given probability, where a part of time series data is warpped by speeding it up or down. |
|
Add noise with a given probability, where the noise is added to the principal components of each channel of the EEG signal. |
|
Applies a random transformation with a given probability to reverse the direction of the input signal in the specified dimension, commonly used for left-right and bottom-up reversal of EEG caps and reversal of timing. |
|
Apply a random transformation such that the input signal becomes the opposite of the reversed sign with a given probability |
|
Apply a shift with a specified probability, after which the specified dimension is shifted backward, and the part shifted out of the Tensor is added to the front of that dimension. |
|
Apply a shuffle with a specified probability, after which the order of the channels is randomly shuffled. |
|
Apply a frequency shift with a specified probability, after which the EEG signals of all channels are equally shifted in the frequency domain. |
Label Transforms¶
Select part of the value from the information dictionary. |
|
Returns a pre-set label for all samples, usually used to supplement the dataset with new categories. |
|
Binarize the label according to a certain threshold. |
|
Binarize the label following the fashion of the one-vs-rest strategy. |
|
Convert multiple binary labels into one multiclass label. |
|
Identify numbers in strings and convert strings to numbers. |
|
Mapping the label according to a certain dictionary. |
Hooks¶
A common hook function used to normalize the signal of the whole trial/session/subject before dividing it into chunks. |
|
A common hook function used to normalize the signal of the whole trial/session/subject after dividing it into chunks and transforming the divided chunks. |
|
A common hook function used to normalize the signal of the whole trial/session/subject after dividing it into chunks and transforming the divided chunks. |
|
A common hook function used to normalize the signal of the whole trial/session/subject after dividing it into chunks and transforming the divided chunks. |