-
Notifications
You must be signed in to change notification settings - Fork 355
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2362 +/- ##
=======================================
Coverage 85.29% 85.29%
=======================================
Files 167 167
Lines 14346 14364 +18
=======================================
+ Hits 12236 12252 +16
- Misses 2110 2112 +2
|
scvi/module/_vae.py
Outdated
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.
scvi/model/base/_log_likelihood.py
Outdated
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?
#2429 needs to be addressed before this |
@ori-kron-wis We can merge this one after fixing the n_samples issue. |
…/scvi-tools into can-expose_mc_samples_de
docs/release_notes/index.md
file if fixing a bug or adding a new featureon-merge: backport to x.x.x
label