-
Notifications
You must be signed in to change notification settings - Fork 63
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 output lengths for layers #491
Conversation
7ea3e36
to
6f112c4
Compare
Can you also add them to the LuxCore API docs? |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
==========================================
- Coverage 88.61% 87.85% -0.77%
==========================================
Files 29 29
Lines 1625 1630 +5
==========================================
- Hits 1440 1432 -8
- Misses 185 198 +13 ☔ View full report in Codecov by Sentry. |
test/layers/basic_tests.jl
Outdated
@test LuxCore.inputsize(layer) == (10, 5) | ||
@test LuxCore.outputsize(layer) == (10, 5) |
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.
@avik-pal is this ok? It seems a bit inconsistent with the size checks above.
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 think outputsize is fine. Do we really need to be able to define inputsize
for Symbolics? I feel we should return a set of possible sizes for the input.
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.
No. I defined it only for consistency, but I'm not sure where it would be useful.
Would that be a tuple of tuples?
@@ -9,6 +9,7 @@ | |||
x = randn(rng, 6, 3) |> aType | |||
|
|||
@test size(layer(x, ps, st)[1]) == (2, 3, 3) | |||
@test Lux.outputsize(layer) == (2, 3) |
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'm not entirely sure if the definition of outputsize
makes sense for ReshapeLayer
.
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.
why?
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'm a bit confused about the fact that the size of the output in the test above (and also in general) has a different size compared to outputsize
because the input also matters and we don't know it from the layer definition.
Should I just implement |
Yes let's restrict the current PR to |
9b269f0
to
b73c174
Compare
You mean |
@avik-pal can you approve ci? |
b73c174
to
7279bdd
Compare
I rebased on master and fixed formatting. I'm not sure why codecov failed. |
@avik-pal Looks like CI passes, the codecov part at the end of the tests is unrelated and seems to randomly fail. |
This PR implements the
inputsize
andoutputsize
interface defined in LuxCore in LuxDL/LuxCore.jl#19I'm not sure if defined this correctly for
ReshapeLayer
andScale
.Also, I'm not sure if the functions can be defined for some of the layers.