Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Adding terms to log density #1041

Open
jpchen opened this issue Oct 7, 2021 · 0 comments
Open

Adding terms to log density #1041

jpchen opened this issue Oct 7, 2021 · 0 comments

Comments

@jpchen
Copy link
Contributor

jpchen commented Oct 7, 2021

From the OpenTeams discussion today, we should have an easy way to add terms to the model density. Something like pyro.factor or pyro.conditionwhich behind the scenes adds an observe statement. We could also add a distribution like the unit distribution to bake in these terms.

facebook-github-bot pushed a commit that referenced this issue Oct 12, 2021
Summary:
Addresses [#1041](#1041). Imported the Unit Dist (with some minor modifications) from pyro. This will allow users to add terms to the model density:
```
bm.random_variable
def increment_log_prob():
    val = Normal(0., 1.).log_prob(1.)
    return Unit(val)
```

In the future we can wrap this with a `factor` statement.

Reviewed By: neerajprad

Differential Revision: D31516303

fbshipit-source-id: b8dc3245e012788c7d5b468aed26535d1cc1b83e
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant