Skip to content
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

Implement a Joint funsor as a normal form / state machine #68

Closed
10 tasks
fritzo opened this issue Mar 10, 2019 · 0 comments
Closed
10 tasks

Implement a Joint funsor as a normal form / state machine #68

fritzo opened this issue Mar 10, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@fritzo
Copy link
Member

fritzo commented Mar 10, 2019

~~Blocked by #51 ~~

It appears that the simplest way to implement an inference strategy is via a Joint funsor that keeps track of various Tensor, Gaussian, and Delta factors in a canonical, searchable data structure. This Joint object is really a state machine / interpreter disguised as a Funsor. Its denotational semantics are defined by its .eager_subs() method, and its operational semantics are defined by the transition operations we call on Joint objects during inference:

  • += a log prob term with either a lazy or eager value
  • .reduce(ops.logaddexp, -) out variables when they are no longer live
  • .reduce(ops.sample, -) variables when they need a ground value (e.g. for control flow)
  • .reduce(ops.add, -) out plates when they are complete (see log_joint in minipyro.py)

Note that this can be sensibly implemented even before we implement sampling #52

Tasks

  • Implement a Joint funsor with Tensor, Gaussian, and various Delta terms
  • Implement += Tensor transition
  • Implement += Gaussian transition
  • Implement += Delta transition
  • Implement .reduce(ops.logaddexp, -) to eliminate random variables
  • Implement .reduce(ops.sample, -) to sample random variables
  • Implement .reduce(ops.add, -) to eliminate plates variables
  • Implement += Joint to fuse two state machines
  • Add tests
  • Use Joint in examples
@fritzo fritzo added the enhancement New feature or request label Mar 10, 2019
@fritzo fritzo self-assigned this Mar 10, 2019
@eb8680 eb8680 self-assigned this Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants