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
chore(module): remove unused code paths in scanvae loss #2644
Conversation
@@ -323,32 +320,6 @@ def loss( | |||
else: | |||
kl_divergence_l = 0.0 | |||
|
|||
if is_labelled: |
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.
feed_labels
is always False
=> y
is always None
=> is_labelled
is always False
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2644 +/- ##
==========================================
+ Coverage 88.78% 88.83% +0.05%
==========================================
Files 158 158
Lines 13245 13234 -11
==========================================
- Hits 11759 11756 -3
+ Misses 1486 1478 -8
|
y = None | ||
is_labelled = False if y is None else True | ||
|
||
# Enumerate choices of label | ||
ys, z1s = broadcast_labels(y, z1, n_broadcast=self.n_labels) |
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.
could probably clean up this function call since y
is always None
- it would help with debugging and addressing #2429
per our discussion in slack @canergen |
sanity check with the Atlas-level integration of lung data tutorial: |
LGTM! Would an old model still load? I guess so as all of these feed_labels are created dynamically. Otherwise, we need to update the scvi-hub scANVI models. |
Not sure it's breaking in this case as it was never active. |
Yeah I think it should be backwards compatible - we have tests for old scanvi loads. |
BREAKING CHANGE: removes unused code paths in the loss method of SCANVAE due to the default being
feed_labels=False
. internal functions that call this method either have their own default set tofeed_labels=False
or havefeed_labels=True
but don't pass it into the loss method (e.g. compute_elbo).also adds typing within the modified file.
closes #2134