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
glossary #999
glossary #999
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -19,3 +19,43 @@ Model development tutorials | |||||||||||||||||||
notebooks/module_user_guide | ||||||||||||||||||||
notebooks/model_user_guide | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
Glossary | ||||||||||||||||||||
-------- | ||||||||||||||||||||
|
||||||||||||||||||||
.. tabs:: | ||||||||||||||||||||
|
||||||||||||||||||||
.. tab:: Model | ||||||||||||||||||||
|
||||||||||||||||||||
A model class is a user-facing object that contains the module as an attribute (i.e., ``self.module``). | ||||||||||||||||||||
The model has a `train` method that learns the parameters of the module, and also contains methods | ||||||||||||||||||||
for users to retrieve information from the module, like the latent representation of cells in a VAE. | ||||||||||||||||||||
Conventionally, the post-inference model methods should not store data into the AnnData object, but | ||||||||||||||||||||
instead return "standard" Python objects, like numpy arrays or pandas dataframes. | ||||||||||||||||||||
|
||||||||||||||||||||
Comment on lines
+31
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
.. tab:: Module | ||||||||||||||||||||
|
||||||||||||||||||||
A module is the lower-level object that defines a generative model and inference scheme. A module will | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
either inherit :class:`~scvi.module.base.BaseModuleClass` or :class:`~scvi.module.base.PyroBaseModuleClass`. | ||||||||||||||||||||
Consequently, a module can either be implemented with PyTorch alone, or Pyro. In the PyTorch only case, the | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
generative process and inference scheme are implemented respectively in the `generative` and `inference` methods, | ||||||||||||||||||||
while the `loss` method computes the, e.g, ELBO in the case of variational inference. | ||||||||||||||||||||
adamgayoso marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
|
||||||||||||||||||||
.. tabs:: | ||||||||||||||||||||
|
||||||||||||||||||||
.. tab:: TrainingPlan | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
The training plan is a PyTorch Lightning Module that is initializd with a scvi-tools module object. | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
It configures the optimizers, defines the training step and validation step, and computes metrics to be | ||||||||||||||||||||
recorded during training. The training step and validation step are functions that take data, run it through | ||||||||||||||||||||
the model and return the loss, which will then be used to optimize the model parameters in the Trainer. | ||||||||||||||||||||
Overall, training plans can be used to develop complex inference schemes on top of modules. | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
.. tab:: Trainer | ||||||||||||||||||||
|
||||||||||||||||||||
The :class:`~scvi.train.Trainer` is a lightweight wrapper of the PyTorch Lightning Trainer. It takes as input | ||||||||||||||||||||
the training plan, a training data loader, and a validation dataloader. It performs the actual training loop, in | ||||||||||||||||||||
which parameters are optimized, as well as the validation loop to monitor metrics. It automatically handles moving | ||||||||||||||||||||
data to the correct device (CPU/GPU). |
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.