Shortcuts

MinMaxNormalize

class torcheeg.transforms.MinMaxNormalize(min: ndarray | None | float = None, max: ndarray | None | float = None, axis: int | None = None, apply_to_baseline: bool = False)[source][source]

Perform min-max normalization on the input data. This class allows the user to define the dimension of normalization and the used statistic.

from torcheeg import transforms

t = transforms.MinMaxNormalize(axis=0)
# normalize along the first dimension (electrode dimension)
t(eeg=np.random.randn(32, 128))['eeg'].shape
>>> (32, 128)

from torcheeg import transforms

t = transforms.MinMaxNormalize(axis=1)
# normalize along the second dimension (temproal dimension)
t(eeg=np.random.randn(32, 128))['eeg'].shape
>>> (32, 128)
Parameters:
  • min (np.array, optional) – The minimum used in the normalization process, allowing the user to provide minimum statistics in np.ndarray format. When statistics are not provided, use the statistics of the current sample for normalization.

  • max (np.array, optional) – The maximum used in the normalization process, allowing the user to provide maximum statistics in np.ndarray format. When statistics are not provided, use the statistics of the current sample for normalization.

  • axis (int, optional) – The dimension to normalize, when no dimension is specified, the entire data is normalized.

  • 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, eeg: ndarray, baseline: ndarray | None = None, **kwargs) Dict[str, ndarray][source][source]
Parameters:
  • eeg (np.ndarray) – The input EEG signals or features.

  • 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 normalized results.

Return type:

np.ndarray

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