braindecode.visualization.random_target#

braindecode.visualization.random_target(target, n_classes, generator=None)[source]#

Return labels uniformly sampled from {0, ..., n_classes-1} \ target.

For each entry of target pick a different class at random. Used in the label-randomization sanity check: query the trained model’s attribution method with the wrong target and check whether the resulting map differs from the correct-target map. Accepts a Python int, NumPy array, or torch tensor and returns the same kind of object on the same device.

Parameters:
Return type:

Same type as target (or int when target is a scalar).

Examples using braindecode.visualization.random_target#

Interpretability of EEG Decoders

Interpretability of EEG Decoders