-
Notifications
You must be signed in to change notification settings - Fork 377
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
Custom dataloader registry support #2932
base: main
Are you sure you want to change the base?
Conversation
…try' into ori-2907-custom-dataloader-registry
…module / registry big change
for more information, see https://pre-commit.ci
…un, we will later adjust this file
Codecov ReportAttention: Patch coverage is
❌ Your project check has failed because the head coverage (81.96%) is below the target coverage (83.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #2932 +/- ##
==========================================
- Coverage 89.43% 81.96% -7.48%
==========================================
Files 185 186 +1
Lines 16182 16439 +257
==========================================
- Hits 14473 13474 -999
- Misses 1709 2965 +1256
|
and fix the test for custom dataloaders
for more information, see https://pre-commit.ci
…oader-registry # Conflicts: # docs/tutorials/notebooks
…com/scverse/scvi-tools into ori-2907-custom-dataloader-registry
for more information, see https://pre-commit.ci
…com/scverse/scvi-tools into ori-2907-custom-dataloader-registry
for more information, see https://pre-commit.ci
…oader-registry # Conflicts: # docs/tutorials/notebooks
…oader-registry # Conflicts: # docs/tutorials/notebooks
import scvi | ||
|
||
if TYPE_CHECKING: | ||
import lamindb as ln |
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.
does this create a requirement for lamindb? Can we make MappedCollectionDataModule a lazy load?
"state_registry": { | ||
"categorical_mapping": self.label_keys, | ||
"original_key": self._label_key, | ||
"unlabeled_category": "unlabeled", |
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.
expose "unlabeled"?
**datasplitter_kwargs, | ||
) | ||
else: | ||
# TODO fix in external dataloader? |
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.
print warning.
@@ -134,6 +148,7 @@ def __init__( | |||
f"dropout_rate: {dropout_rate}, dispersion: {dispersion}, " | |||
f"gene_likelihood: {gene_likelihood}, latent_distribution: {latent_distribution}." | |||
) | |||
self._module_init_on_train = False | |||
|
|||
if self._module_init_on_train: |
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.
remove module_init_on_train. This is deprecated code with the new dataloader implementation.
) | ||
else: | ||
# custom datamodule | ||
n_cats_per_cov = self.summary_stats[f"n_{REGISTRY_KEYS.CAT_COVS_KEY}"] |
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.
does this work for AnnData? Can we remove the if statement here?
No description provided.