Comments (4)
I believe the above code computes the posterior predictive log density, which includes both prior and likelihood. In the past, when I've computed log-likelhood, I've manually masked out the prior sites. I'm unsure whether it's practical to automatically mask out prior sites in a way that is correct for reparametrization and other auxiliary variables.
Maybe a first step could be adding a log-likelihood computation to a couple existing tutorials, then seeing if there's a general implementation (that is e.g. batchable)?
from pyro.
@fritzo thanks for pointing out my mistake, much appreciated! Was just wondering how did you mask out your prior sites systematically (I'm very much new to Pyro)? You're right, it might be worth wrtiting up a couple of tutorials fot the log-likelihood computation, do you have any recommendations of where to start?
from pyro.
how did you mask out your prior sites systematically?
I've enclosed the top of a hierarchical model in a boolean poutine.mask(mask=___)
, e.g.
def example_model(data, include_prior: bool = True):
# Sample top level variables from the prior.
with poutine.mask(mask=include_prior):
loc = pyro.sample("loc", Normal(0, 1))
scale = pyro.sample("scale", LogNormal(0, 1))
# Observe data.
pyro.sample("data", Normal(loc, scale), obs=data)
do you have any recommendations of where to start?
Gosh there are over 50 tutorials on https://pyro.ai/examples . You might pick a domain you're interested in and add a section at the end. Then "likelihood" should still show up in search results.
from pyro.
@fritzo Thanks for this. Great, I can add them in the tutorial, might be useful!
from pyro.
Related Issues (20)
- Add detailed descriptions of `Message` and `InferDict` keys HOT 2
- [FR] Tutorial on PyroModule + ELBO module training with torch optimizers
- [discussion] Time Complexity of calculating ITEs in CEVAE HOT 1
- VS Code mypy warnings due to Pyro's type hints HOT 1
- Torchscript error in JitTraceEnum_ELBO Torch Version 2.2.1, CUDA Version: 12.3 HOT 1
- Using PyroModule with torch.nn.ModueList fails for nested modules HOT 2
- Got runtime error when using hmc / mcmc together with sequential enumeration
- [BUG] Coregionalize() kernel unable to be used HOT 2
- Use of the outdated 'jupyter' metapackage HOT 3
- [FR] Predictive with deterministic site in the guide HOT 6
- How to confirm the training is converged? HOT 1
- Rendering PyroModules can fail with local parameter mode enabled
- No posterior samples when using categorical distribution [bug]
- [discussion] Parameters not rendering when feeding into `pyro.deterministic` HOT 1
- Add effect handler that forces sample sites to sample the same value [feature request] HOT 1
- Bug of dist.Categorical(prob) and sampling HOT 1
- E-Mail in CODE_OF_CONDUCT.md probably not correct any more? HOT 2
- Normalization of Weights within SMCFilter class HOT 2
- Utilities for simplifying interactions between PyroSample and plates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyro.