Shortcuts

Binary

class torcheeg.transforms.Binary(threshold: float)[source][source]

Binarize the label according to a certain threshold. Labels larger than the threshold are set to 1, and labels smaller than the threshold are set to 0.

from torcheeg import transforms

t = transforms.Binary(threshold=5.0)
t(y=4.5)['y']
>>> 0

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

from torcheeg import transforms

t = transforms.Binary(threshold=5.0)
t(y=[4.5, 5.5])['y']
>>> [0, 1]
Parameters:

threshold (float) – Threshold used during binarization.

__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

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