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
Fixes error in get losses functions #2362
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2362 +/- ##
==========================================
- Coverage 89.42% 88.90% -0.52%
==========================================
Files 153 153
Lines 12564 12582 +18
==========================================
- Hits 11235 11186 -49
- Misses 1329 1396 +67 ☔ View full report in Codecov by Sentry. |
if n_mc_samples_per_pass == 1: | ||
log_prob_sum = log_prob_sum.unsqueeze(0) |
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.
Wait so does this mean that this method was not working properly before? Since the default is n_mc_samples_per_pass=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.
Yes but we only use it for DE genes where it's called with n_samples_per_mc of 100 (?). ScANVI wasn't supporting importance weighting in DE beforehand.
ScANVI doesn't work with multiple samples (major work to fix this) and this might be an issue for multi-GPU support (see bug report). If you want to fix this, I have a fix for broadcast labels but then dropped it as also the encoder doesn't support it.
elbo += kl_global | ||
return elbo / n_samples | ||
else: | ||
return elbo + kl_global / n_samples |
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.
Probably best to also use torch operations here since compute_reconstruction_error
doesn't use numpy. Let me know what you think
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.
Fine with me. Can you puh those changes?
I'll get this in by today @canergen |
#2429 needs to be addressed before this |
docs/release_notes/index.md
file if fixing a bug or adding a new featureon-merge: backport to x.x.x
label