Coder Social home page Coder Social logo

Comments (4)

fritzo avatar fritzo commented on August 16, 2024

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.

julian-8897 avatar julian-8897 commented on August 16, 2024

@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.

fritzo avatar fritzo commented on August 16, 2024

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.

julian-8897 avatar julian-8897 commented on August 16, 2024

@fritzo Thanks for this. Great, I can add them in the tutorial, might be useful!

from pyro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.