EDIT: I had thought this was a question about Soss (you didn’t specify a PPL in the text), but I just noticed the
turing tag. So… maybe nevermind?
Return statements are a
coming soon feature. We want to be able to write, for example,
mycauchy() = @model begin
x ~ Normal()
y ~ Normal()
rand(mycauchy()) would just return a
That part is simple enough. But how would we implement
logpdf(mycauchy(), c::Float64)? In this case we can figure it out, but there are too many options for a way to do this in general, and they’re all much slower than we’d like.
What we need is a way to pass the internal state as well. And a quick fix won’t really do it, we need the result to be nicely composable. For example, say we have a “slash distribution”,
slash = @model a,b begin
x ~ a
y ~ b
The arguments to
slash might be
Distributions, or could themselves for Soss models. We need things to propagate correctly in either case.
I think there will be a lot of advantages to this once we straighten it out, but it will take thinking through it some more to be sure we get it right. I think we’ll take some ideas from Gen on this, but there are some details to work through.