braindecode.visualization.capture_activations#

braindecode.visualization.capture_activations(model, x, layer)[source]#

Return the output emitted by layer during model(x).

Nested outputs are returned unchanged. If a layer runs more than once, only its last output is kept.

Parameters:
  • model (Module) – Model to run.

  • x (torch.Tensor) – Model input.

  • layer (Module) – Submodule whose output is captured.

Raises:

RuntimeError – If layer is not called by the forward pass.