-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if 'cnn_output_size' is zero in CNNembedding. #1281
Check if 'cnn_output_size' is zero in CNNembedding. #1281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you!!
Thank you for letting me know. Pushed ruff linting related fixes 👍 . |
Great! Ruff is passing now, I will merge once all other tests are also through. Thanks again! |
Unfortunately, one of the tests has failed. To reproduce: This gives
Could you have a look? |
Made the fix, and confirmed with the tests. This should be okay now 👍. Sorry, missed the variability with 1D convs before. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1281 +/- ##
===========================================
- Coverage 89.24% 78.39% -10.86%
===========================================
Files 119 119
Lines 8695 8849 +154
===========================================
- Hits 7760 6937 -823
- Misses 935 1912 +977
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@michaeldeistler, Just curious, does this PR needs more modification? Or you think this addition would not be much useful? Thanks. |
Hi there, sorry I am currently travelling and therefore was a bit slow to have another look. I just ran tests, if they pass then I will merge. Thanks a lot for the contribution! |
Ah, I see. No worries. It seems all the tests pass now. Thanks, you can merge it whenever it is possible for you. Also, It's an amazing opensource library. Thanks for creating it. |
When configuring the CNN-based embedding layer using
sbi.neural_nets.embedding_nets.CNNEmbedding
, setting the parameters fornum_cnn_layers
,kernel_size
, andpool_kernel_size
incorrectly may result in a vague error message, such as:RuntimeError: Given input size: (6x4x4). Calculated output size: (6x0x0). Output size is too small.
Proposed Solution:
Since the
cnn_output_size
is recalculated after each layer, a CNN setup with excessive depth results in an output size of zero. This could be leveraged to alert the user about appropriate layer size configurations or to adjust other parameters accordingly.