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
Add test for image and video CNNs #134
Conversation
Codecov Report
@@ Coverage Diff @@
## main #134 +/- ##
===========================================
+ Coverage 24.56% 51.00% +26.44%
===========================================
Files 44 44
Lines 4096 4096
===========================================
+ Hits 1006 2089 +1083
+ Misses 3090 2007 -1083
Continue to review full report at Codecov.
|
|
||
assert isinstance(feature_network, dict) | ||
|
||
assert isinstance(feature_network, dict) |
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.
Duplication with line 21, remove one of them?
tests/embed/test_video_i3d_r3d.py
Outdated
INPUT_BATCH_RGB = torch.randn(2, 3, 16, 112, 112) | ||
INPUT_BATCH_FLOW = torch.randn(2, 2, 8, 112, 112) | ||
SE_LAYERS = ["SELayerC", "SELayerT", "SELayerCoC", "SELayerMC", "SELayerMAC", "SELayerCT", "SELayerTC"] | ||
set_seed(36) |
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.
I know that this won't fail the tests but it should be better to always set seed before using random functions, i.e., putting it before line 13 will be better, isn't it?
|
||
BATCH_SIZE = 2 | ||
INPUT_BATCH = torch.randn(BATCH_SIZE, 128) | ||
INPUT_BATCH_LOGITS = torch.randn(BATCH_SIZE, 1024, 1, 1, 1) |
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.
I could guess what it is for but adding some light comment about what line 15 is will help users or new comers. This code not only serves the purpose of test coverage, but also can teach others how to write proper tests. Thanks.
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.
@xianyuanliu I should make it clearer: could you explain a bit INPUT_BATCH_LOGITS
vs INPUT_BATCH
? Is INPUT_BATCH_LOGITS
some synthetic output from previous layers (i.e. output of the I3D)?
Or provide some references about the _LOGITS
. It is not as obvious as INPUT_BATCH
.
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.
@xianyuanliu I should make it clearer: could you explain a bit
INPUT_BATCH_LOGITS
vsINPUT_BATCH
? IsINPUT_BATCH_LOGITS
some synthetic output from previous layers (i.e. output of the I3D)?Or provide some references about the
_LOGITS
. It is not as obvious asINPUT_BATCH
.
Or maybe changing _LOGITS
to _I3D
?
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.
Amazing efforts to have the coverage doubled, from 25% to 51%!!!!!!
Just some minor comments to address before merging.
Updated. |
Description
Add test for video cnns and image cnns.
Status
Ready
Types of changes