Skip to content

FIX apply Deep4 short-input scaling to CombinedConv kernel - #1215

Merged
bruAristimunha merged 3 commits into
braindecode:masterfrom
lindicaphxag-tech:fix/deep4-scaled-temporal-kernel
Oct 5, 2026
Merged

bruAristimunha merged 3 commits into
braindecode:masterfrom
lindicaphxag-tech:fix/deep4-scaled-temporal-kernel

Conversation

@lindicaphxag-tech

Copy link
Copy Markdown
Contributor

Summary

Deep4Net scales its temporal kernel and pooling parameters when n_times is below the model's minimum supported length. In the split-first-layer path, however, the actual CombinedConv was still constructed with the original filter_time_length argument rather than the scaled self.filter_time_length.

That leaves the public model attributes and the real first-layer kernel out of sync after auto-scaling.

Fix

Pass the scaled self.filter_time_length into CombinedConv.

Regression coverage

The test uses a short input (n_times=300) that triggers the existing auto-scaling path and checks that:

  • the temporal kernel is actually reduced;
  • conv_time_spat.conv_time.kernel_size[0] matches model.filter_time_length;
  • the resulting model completes a forward pass.

This is independent of the separate stride-before-pool and unsplit-first-layer fixes.

Copy link
Copy Markdown
Contributor Author

Exact-head validation is green on 0b93863a4398e5fc2cb0149d53cc86b3412412a6: the short-input CombinedConv kernel-scaling regression passes and repository pre-commit passes on the touched model/test files. Evidence: https://github.com/lindicaphxag-tech/lindicaphxag-tech/actions/runs/37145822074. I’ll hold this head for review.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.98%. Comparing base (2426ddc) to head (f49b7d8).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1215      +/-   ##
==========================================
+ Coverage   87.84%   87.98%   +0.14%     
==========================================
  Files         151      151              
  Lines       17602    17615      +13     
==========================================
+ Hits        15462    15499      +37     
+ Misses       2140     2116      -24     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bruAristimunha bruAristimunha 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.

Thanks. Reproduced the kernel/attribute desync on master, confirmed the scaled filter_time_length now reaches CombinedConv and default configs are unchanged. CI green.

Resolved docs/whats_new.rst by keeping both changelog entries.

@bruAristimunha bruAristimunha 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.

Thanks. Reproduced the kernel/attribute desync on master, confirmed the scaled filter_time_length now reaches CombinedConv and default configs are unchanged. Tests green; the only red check is the Codecov upload (infra).

@bruAristimunha bruAristimunha added the maintenance Bug fix / refactor / tests — not a new model label Oct 5, 2026
Resolved docs/whats_new.rst and test_models.py insertion conflicts by keeping both sides.

@bruAristimunha bruAristimunha 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.

Thanks. Reproduced the kernel/attribute desync on master; scaled filter_time_length now reaches CombinedConv; default configs unchanged.

@bruAristimunha
bruAristimunha merged commit d18a5d2 into braindecode:master Oct 5, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Bug fix / refactor / tests — not a new model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants