selfeeg.utils

This module simply gathers functions and classes for various purposes. For example, you can find a torch implementation of the Scipy’s pchip interpolation function (used for resampling) or pytorch EEG scaler with a soft clipping option. Both the cited functions are compatible with GPU tensors.

Classes

RangeScaler

class adaptation of the scale_range_with_soft_clip function.

ZscoreScaler

zscore operator callable objects.

Functions

check_models

checks that two nn.Modules are equal.

count_parameters

counts the number of trainable parameters of a Pytorch's nn.Module.

create_dataset

creates a simulated EEG dataset for normal abnormal binary classification.

get_subarray_closest_sum

find the subarray whose values sum is closer to a target.

scale_range_soft_clip

soft version of the range scaler.

torch_pchip

performs the pchip interpolation on the last dimension of the input tensor.

torch_zscore

zscore operator for torch tensors.