rlouf / mcx

Express & compile probabilistic programs for performant inference on CPU & GPU. Powered by JAX.
https://rlouf.github.io/mcx
Apache License 2.0
325 stars 17 forks source link

Discrete variables #39

Closed rlouf closed 3 years ago

rlouf commented 3 years ago

We need to settle on an API design before the first release as it could affect the internals of inference quite a bit. There are several ways to go about sampling discrete variables:

Of all these algorithms, Gibbs is probably the most challenging to implement. What would it look like?

kernel = Gibbs(
    x = HMC(100),
    z = HMC(100),
    y = RWMH(BinaryProposal())
)

Or to avoid repetitiions

kernel = Gibbs({
    HMC(100): ['x', 'z'],
    RWMH(BinaryProposal()): 'y'
})
rlouf commented 3 years ago

Discussion moved to #95