-
Notifications
You must be signed in to change notification settings - Fork 346
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
interoperability with pyro to simplify implementing complex hierarchical priors? #862
Comments
Hi Vitalii, We don't currently support pyro -- we could after we finish the current model changes (move to pytorch lightning for training and it seems pyro can work with pytorch lightning). Since you're considering amortized VI, do you have a sketch already of the model and posteriors? I see your model has many latent variables, but if you're using a mean field approximation, manually coding the ELBO maybe could not be so challenging? I'm happy to continue this discussion, but it would be very helpful for us to continue at https://discourse.scvi-tools.org/ -- which we are hoping to use for topics like this. |
Hi Adam Support for pyro would be quite amazing. Sound like it is better to wait until you finish the changes. I will re-initiate the discussion on the forum. With this many parameters, my concern is that it would be necessary to reinvent something similar to pyro to automatically collect KL contributions from parameters. I struggle a bit with wrapping my head around the minimal number of steps needed to add this to scVI (I tried inferring this from the AutoZiVAE model but it has extra bits like reparametrisation of Beta distr. which make it harder to understand what is minimally needed). |
@vitkl now that we have redone our backend, we are going to explore interoperability with Pyro. It actually seems like it can be easily done. Do you have a version of your model in pyro now that I could take a look at? If this all works out and you're interested, you'd be able to have a model potentially in |
Hi Adam
This sounds very exciting! Keep me posted.
You can take this model for example:
https://github.com/BayraktarLab/cell2location/blob/a03b9dc03c97f326f384c15fa0b276273d9d38a9/cell2location/models/LocationModelLinearDependentWPyro.py#L179
It relies on Pyro AutoNormal guide / Variational distribution. Ideally it
would be possible to combine AutoNormal guide for global parameters and
amortized inference encoder NN on local parameters for each observation.
Thanks for pointers - we will think about the choices
…On Thu, 28 Jan 2021, 19:02 Adam Gayoso, ***@***.***> wrote:
@vitkl <https://github.com/vitkl> now that we have redone our backend, we
are going to explore interoperability with Pyro. It actually seems like it
can be easily done. Do you have a version of your model in pyro now that I
could take a look at?
If this all works out and you're interested, you'd be able to have a model
potentially in scvi.external, or you can use our new template repository (
https://github.com/YosefLab/scvi-tools-skeleton)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#862 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFMFTV7IIFE7LWZFU7PW6GLS4GYDZANCNFSM4T67WIDQ>
.
|
Thanks for sharing. I'm hoping the interface will be generic enough such that your code would just basically have to be copy pasted into different places -- structured in such a way that it will interface well with our higher-level models and black box train methods. |
Hi scVI team!
I am wondering if you are planning any interoperability with pyro to simplify implementing complex hierarchical priors? Maybe you have other ideas of simplifying that? I would like to try to adding Variational Autoencoding posteriors to cell2location (https://github.com/BayraktarLab/cell2location, https://www.biorxiv.org/content/10.1101/2020.11.15.378125v1.full) - would be cool if this is possible by integrating with scVI.
Thanks
Vitalii
The text was updated successfully, but these errors were encountered: