braindecode.modules.LinearWithConstraint#
- class braindecode.modules.LinearWithConstraint(*args, max_norm=1.0, **kwargs)[source]#
Linear layer with max-norm constraint on the weights.
Examples
>>> import torch >>> from braindecode.modules import LinearWithConstraint >>> module = LinearWithConstraint(10, 5, max_norm=1.0) >>> inputs = torch.randn(2, 10) >>> outputs = module(inputs) >>> outputs.shape torch.Size([2, 5])