Shortcuts

Mapping

class torcheeg.transforms.Mapping(map_dict: float, default: float = -1)[source][source]

Mapping the label according to a certain dictionary.

from torcheeg import transforms

t = Mapping({
    'left_hand': 0,
    'right_hand': 1,
})
t(y='left_hand')['y']
>>> 0

Mapping allows simultaneous binarization using the same threshold for multiple labels.

from torcheeg import transforms

t = Mapping({
    'left_hand': 0,
    'right_hand': 1,
    'left_feet': 0,
    'right_feet': 1
})
t(y=['left_hand', 'left_feet'])['y']
>>> [0, 0]
Parameters:
  • map_dict (float) – The mapping dictionary.

  • default (float, optional) – The default value when the input label is not in the dictionary. (default: -1)

__call__(*args, y: int | float | List, **kwargs) int | List[source][source]
Parameters:

label (int, float, or list) – The input label or list of labels.

Returns:

The output label or list of labels after binarization.

Return type:

int, float, or list

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