-
Notifications
You must be signed in to change notification settings - Fork 25
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
[python] Initial work toward PyTorch data loaders #2823
base: main
Are you sure you want to change the base?
Conversation
…ed lint/formatting issues
…experimentdatapipe
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2823 +/- ##
==========================================
+ Coverage 89.64% 89.79% +0.14%
==========================================
Files 39 39
Lines 4096 4096
==========================================
+ Hits 3672 3678 +6
+ Misses 424 418 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
) -> torch.utils.data.DataLoader: | ||
"""Factory method for :class:`torch.utils.data.DataLoader`. This method can be used to safely instantiate a | ||
:class:`torch.utils.data.DataLoader` that works with :class:`tiledbsoma_ml.ExperimentAxisQueryIterableDataset` | ||
or :class:`tiledbsoma_ml.ExperimentAxisQueryIterDataPipe`. |
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.
or :class:`tiledbsoma_ml.ExperimentAxisQueryIterDataPipe`. | |
or :class:`tiledbsoma_ml.ExperimentAxisQueryDataPipe`. |
I don't think ExperimentAxisQueryIterDataPipe
is a thing but I could be missing something...
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 used both names, all over the place. The original idea was to reflect the parent/base class, from which the API pattern is borrowed. Given this, I've changed it to IterDataPipe
, which is the torchdata
name for this style of pipe.
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
other_packages/python/tiledbsoma_ml/src/tiledbsoma_ml/pytorch.py
Outdated
Show resolved
Hide resolved
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.
This is awesome. I'm excited to start testing it out. The docs are comprehensive and super clear. My suggested changes are largely minor typos and small improvements for clarity/consistency.
Notes to reviewers:
tutorial_pytorch.ipynb
) has been updated to run with all API modifications.This PR contains a PyTorch iterable-style DataSet/DataPipe for use with SOMA Experiment. Initial code contributed by the Chan Zuckerberg single-cell team. Modifications to the original code include:
tiledbsoma_ml
API change summary:
ExperimentAxisQuery
, rather than than anExperiment
Benchmarking results vs the
cellxgene-census
loader will be forthcoming shortly.