braindecode / braindecode

Deep learning software to decode EEG, ECG or MEG signals
https://braindecode.org/
BSD 3-Clause "New" or "Revised" License
756 stars 173 forks source link

Create test for a default parameter for the models #542

Closed bruAristimunha closed 4 months ago

bruAristimunha commented 10 months ago
          @sliwy not sure all the models can be initialized with their default parameters.

Plus I think we should test if the models accept inputs with the desired shape and return outputs with the correct shape:

from braindecode.models.util import models_dict
@pytest.mark.parametrize("model_cls", models_dict.values())
def test_model_torchinfo(model_cls):
    model = model_cls(n_times=5000, n_chans=1, n_outputs=2)
    assert model(torch.ones(3, 1, 5000)).shape == (3, 2)

Originally posted by @PierreGtch in https://github.com/braindecode/braindecode/issues/538#issuecomment-1725468288