Skip to content

FIX allow Deep4 explicit final_conv_length without n_times - #1214

Merged
bruAristimunha merged 5 commits into
braindecode:masterfrom
lindicaphxag-tech:fix/deep4-optional-n-times
Oct 5, 2026
Merged

bruAristimunha merged 5 commits into
braindecode:masterfrom
lindicaphxag-tech:fix/deep4-optional-n-times

Conversation

@lindicaphxag-tech

Copy link
Copy Markdown
Contributor

Summary

Deep4Net documents n_times as required only when final_conv_length="auto", but the minimum-length scaling path currently compares self.n_times < min_n_times unconditionally. With an explicit final convolution length and n_times=None, construction therefore raises a TypeError before the model can be used.

This PR keeps the existing auto-scaling behavior when n_times is known and skips that check when the input length is intentionally unspecified.

Regression coverage

Adds a focused test that constructs

Deep4Net(
    n_chans=18,
    n_outputs=2,
    n_times=None,
    final_conv_length=1,
)

and verifies a normal forward pass on a runtime input tensor.

The change is independent of the CombinedConv/stride fixes: it only restores the documented explicit-head API contract.

Copy link
Copy Markdown
Contributor Author

Exact-head validation is green on 501b38f30b8de6e226bea111c835b92b76de4576: the explicit-final_conv_length/n_times=None 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 (0265f0f).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1214      +/-   ##
==========================================
+ 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 on master, confirmed the one-variable fix restores explicit final_conv_length without n_times and leaves default configs unchanged (0.0 output diff). 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 on master, confirmed the one-variable fix restores explicit final_conv_length without n_times and leaves default configs unchanged (0.0 output diff). Tests green; the only red check is the Codecov upload (infra).

Resolved docs/whats_new.rst by keeping both changelog entries.
@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 on master; the one-variable fix restores explicit final_conv_length without n_times, default configs unchanged (0.0 diff).

@bruAristimunha
bruAristimunha merged commit 0891d74 into braindecode:master Oct 5, 2026
3 of 5 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