Project-MONAI / GenerativeModels

MONAI Generative Models makes it easy to train, evaluate, and deploy generative models and related applications
Apache License 2.0
604 stars 87 forks source link

Add ability to compute likelihoods from all models #118

Closed marksgraham closed 1 year ago

marksgraham commented 1 year ago

It will be useful to be able to easily compute the likelihood (or some bound on the likelihood, where the exactly likelihood is not available) from all our models, and a prerequisite for some issues, e.g. #112

marksgraham commented 1 year ago

Curious to get thoughts on this @Warvito @ericspod. Should this live as another method in the Inferer for each model, so we have .compute_likelihood() as well as .sample()?

ericspod commented 1 year ago

Things should go where they need to be to access the data they need. Computations which require only the scheduler go there, if you need the network and scheduler then it makes sense in Inferer though it's a strange sort of inference. sample is in Inferer I'd say because it's a form of inference. That's at least how I'd think about it if anyone else has a position.

marksgraham commented 1 year ago

The computation needs both, especially for latent diffusion/transformer models, so I think Infererer it is. will also have a nice consistent interface for sample/get_likelihood this way

Warvito commented 1 year ago

As soon #104 is merged, the transformer will be ready to implement get likelihood method

marksgraham commented 1 year ago

I can work on it, I'm training some transformers this week so good timing!

El dom, 12 de feb de 2023 05:32, Walter Hugo Lopez Pinaya < @.***> escribió:

As soon #104 https://github.com/Project-MONAI/GenerativeModels/issues/104 is merged, the transformer will be ready to implement get likelihood method

— Reply to this email directly, view it on GitHub https://github.com/Project-MONAI/GenerativeModels/issues/118#issuecomment-1427008502, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4UIM6FOX6ZJSL3HEEFLM3WXDC5HANCNFSM6AAAAAASQ5U3OI . You are receiving this because you authored the thread.Message ID: @.***>