Shortcuts

torcheeg.transforms

Datatype-independent Transforms

Compose

Compose several transforms together.

Lambda

Apply a user-defined lambda as a transform.

BaselineRemoval

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

CWTSpectrum

A transform method to convert EEG signals of each channel into spectrograms using wavelet transform.

BandSignal

A transform method to split the EEG signal into signals in different sub-bands.

BandDifferentialEntropy

A transform method for calculating the differential entropy of EEG signals in several sub-bands with EEG signals as input.

BandPowerSpectralDensity

A transform method for calculating the power spectral density of EEG signals in several sub-bands with EEG signals as input.

BandMeanAbsoluteDeviation

A transform method for calculating the mean absolute deviation of EEG signals in several sub-bands with EEG signals as input.

BandKurtosis

A transform method for calculating the kurtosis of EEG signals in several sub-bands with EEG signals as input.

BandSkewness

A transform method for calculating the skewness of EEG signals in several sub-bands with EEG signals as input.

DWTDecomposition

Splitting the EEG signal from each electrode into two functions using wavelet decomposition.

BandApproximateEntropy

A transform method for calculating the approximate entropy of EEG signals in several sub-bands with EEG signals as input.

BandSampleEntropy

A transform method for calculating the sample entropy of EEG signals in several sub-bands with EEG signals as input.

BandSVDEntropy

A transform method for calculating the SVD entropy of EEG signals in several sub-bands with EEG signals as input.

BandDetrendedFluctuationAnalysis

A transform method for calculating the detrended fluctuation analysis (DFA) of EEG signals in several sub-bands with EEG signals as input.

BandPetrosianFractalDimension

A transform method for calculating the petrosian fractal dimension (PFD) of EEG signals in several sub-bands with EEG signals as input.

BandHiguchiFractalDimension

A transform method for calculating the higuchi fractal dimension (HFD) of EEG signals in several sub-bands with EEG signals as input.

BandHjorth

A transform method for calculating the hjorth mobility/complexity of EEG signals in several sub-bands with EEG signals as input.

BandHurst

A transform method for calculating the hurst exponent of EEG signals in several sub-bands with EEG signals as input.

BandBinPower

A transform method for calculating the power of EEG signals in several sub-bands with EEG signals as input.

ARRCoefficient

Calculate autoregression reflection coefficients on the input data.

BandSpectralEntropy

A transform method for calculating the spectral entropy of EEG signals in several sub-bands with EEG signals as input.

PearsonCorrelation

A transform method to calculate the correlation coefficients between the EEG signals of different electrodes.

PhaseLockingCorrelation

A transform method to calculate the phase locking values between the EEG signals of different electrodes.

MeanStdNormalize

Perform z-score normalization on the input data.

MinMaxNormalize

Perform min-max normalization on the input data.

PickElectrode

Select parts of electrode signals based on a given electrode index list.

To2d

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.

ToGrid

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].

ToInterpolatedGrid

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].

Concatenate

Merge the calculation results of multiple transforms, which are used when feature fusion is required.

MapChunk

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

Downsample the EEG signal to a specified number of data points.

RearrangeElectrode

Select parts of electrode signals based on a given electrode index list.

Flatten

Flatten the input EEG representation.

PyG-based Transforms

pyg.ToG

A transformation method for constructing a graph representation of EEG signals, the results of which are applied to the input of the torch_geometric model.

pyg.ToDynamicG

A transformation method for dynamically constructing the functional connections between electrodes according to the input EEG signals.

Torch-based Transforms

ToTensor

Convert a numpy.ndarray to tensor.

Resize

Use an interpolation algorithm to scale a grid-like EEG signal at the spatial dimension.

RandomNoise

Add random noise conforming to the normal distribution on the EEG signal.

RandomMask

Overlay the EEG signal using a random mask, and the value of the overlaid data points was set to 0.0.

RandomWindowSlice

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.

RandomWindowWarp

Apply the window warping with a given probability, where a part of time series data is warpped by speeding it up or down.

RandomPCANoise

Add noise with a given probability, where the noise is added to the principal components of each channel of the EEG signal.

RandomFlip

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.

RandomSignFlip

Apply a random transformation such that the input signal becomes the opposite of the reversed sign with a given probability

RandomShift

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.

RandomChannelShuffle

Apply a shuffle with a specified probability, after which the order of the channels is randomly shuffled.

RandomFrequencyShift

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

Select part of the value from the information dictionary.

FixCategory

Returns a pre-set label for all samples, usually used to supplement the dataset with new categories.

Binary

Binarize the label according to a certain threshold.

BinaryOneVSRest

Binarize the label following the fashion of the one-vs-rest strategy.

BinariesToCategory

Convert multiple binary labels into one multiclass label.

StringToInt

Identify numbers in strings and convert strings to numbers.

Mapping

Mapping the label according to a certain dictionary.

Hooks

before_hook_normalize

A common hook function used to normalize the signal of the whole trial/session/subject before dividing it into chunks.

after_hook_normalize

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.

after_hook_running_norm

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.

after_hook_linear_dynamical_system

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.

Read the Docs v: latest
Versions
latest
stable
v1.1.1
v1.1.0
v1.0.11
v1.0.10
v1.0.9
v1.0.8.post1
v1.0.8
v1.0.7
v1.0.6
v1.0.4
v1.0.3
v1.0.2
v1.0.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources