Shortcuts

FixCategory

class torcheeg.transforms.FixCategory(value: int | str | List)[source][source]

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

from torcheeg import transforms

t = transforms.FixCategory(value=0)
t(y=3)['y']
>>> 0

FixCategory allows multiple values to be selected and returned as a list. Suitable for multi-classification tasks or multi-task learning.

from torcheeg import transforms

t = transforms.FixCategory(value=[0, 1])
t(y=[1, 2])['y']
>>> [0, 1]
Parameters:

value (str or list) – The pre-set label.

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

y (any) – A label or label list describing the EEG signal samples.

Returns:

FixCategoryeded value pre-set by value.

Return type:

any

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