braindecode.functional.exact_derivation#

braindecode.functional.exact_derivation(target, inputs, atol=1e-09)[source]#

W with W @ x the target channels, from the inputs x.

A target is exact when its row of derivation_matrix() is a combination of the input rows: F3-C3 from C3-F3 (weight -1), F3-P3 from F3-C3 and C3-P3, F3-C3 from F3 and C3. This is linear_channel_map() with every potential unknown, so W is the minimum-norm solution and duplicate measurements are averaged. No reference is guessed: F3-C3 is not exact from F3-R1 and C3-R2, and F3 is not exact from bipolar channels alone.

Parameters:
Return type:

tuple[Tensor, Tensor]

Returns:

  • weight (torch.Tensor) – (len(target), len(inputs)), float64; rows of non-exact targets are 0.

  • exact (torch.Tensor) – (len(target),) bool.