Skip to content

[EHN] FBCNet model - #722

Merged
bruAristimunha merged 7 commits into
braindecode:masterfrom
bruAristimunha:fbcnet-v2
Apr 17, 2025
Merged

bruAristimunha merged 7 commits into
braindecode:masterfrom
bruAristimunha:fbcnet-v2

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

Introduce the FBCNet model into the codebase, including its integration into the model list and relevant tests. Update documentation to reflect this addition.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces the FBCNet model into the codebase with its full implementation, test coverage, and integration into the model registry and documentation. Key changes include:

  • New FBCNet model implementation along with corresponding tests in unit and integration files
  • Update to the models dictionary in braindecode/models/util.py and adjustment to the modules (e.g. LinearWithConstraint modification and added temporal aggregator layers)
  • Minor update to the pre-commit configuration to ignore an additional word

Reviewed Changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/unit_tests/models/test_modules.py Updated imports and added fixtures to support LinearWithConstraint tests
test/unit_tests/models/test_models.py Added FBCNet tests for forward pass, parameter count, stride warnings, and error handling
test/unit_tests/models/test_integration.py Integrated FBCNet into the test suite for model parameter checks
braindecode/models/util.py Added FBCNet to the models dictionary
braindecode/models/modules.py Modified LinearWithConstraint's constructor and added new aggregator layers (MeanLayer, MaxLayer, etc.)
braindecode/models/fbcnet.py New implementation of the FBCNet model
braindecode/models/init.py Imported FBCNet for external use
.pre-commit-config.yaml Updated the ignore list for codespell to include an extra word
Files not reviewed (3)
  • braindecode/models/summary.csv: Language not supported
  • docs/api.rst: Language not supported
  • docs/whats_new.rst: Language not supported
Comments suppressed due to low confidence (2)

test/unit_tests/models/test_models.py:1295

  • [nitpick] The error message 'Did expect a convolutional classifier.' is grammatically awkward; consider revising it to 'Expected a convolutional classifier.'
assert "conv_classifier" in submodule_names, "Did expect a convolutional classifier."

test/unit_tests/models/test_models.py:1296

  • [nitpick] The assertion message 'Did not expected a linearconstraint sub-module.' contains a grammatical error; please update it to 'Did not expect a linearconstraint sub-module.'
assert "linearconstraint" not in submodule_names, "Did not expected a linearconstraint sub-module."

@codecov

codecov Bot commented Apr 17, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 97.46835% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.41%. Comparing base (dbf1647) to head (2d72867).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #722      +/-   ##
==========================================
+ Coverage   87.31%   87.41%   +0.10%     
==========================================
  Files          78       79       +1     
  Lines        7235     7313      +78     
==========================================
+ Hits         6317     6393      +76     
- Misses        918      920       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martinwimpff martinwimpff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, the current implementation of the aggregation layers is a bit too verbose.

Comment thread braindecode/models/fbcnet.py Resolved
Comment thread braindecode/models/fbcnet.py Resolved
Comment thread braindecode/models/fbcnet.py Resolved
Comment thread braindecode/models/modules.py Resolved
bruAristimunha and others added 4 commits April 17, 2025 12:08
Co-authored-by: Martin Wimpff <42936990+martinwimpff@users.noreply.github.com>
@bruAristimunha

Copy link
Copy Markdown
Collaborator Author

No regression on the benchmark using the filter bank as layer:

image

@bruAristimunha
bruAristimunha merged commit 8b443e5 into braindecode:master Apr 17, 2025
@bruAristimunha
bruAristimunha deleted the fbcnet-v2 branch April 17, 2025 11:05
@bruAristimunha

Copy link
Copy Markdown
Collaborator Author

thank you @martinwimpff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants