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

Can't nest rejection-query inside enumeration-query #21

Open
longouyang opened this issue Oct 24, 2013 · 3 comments
Open

Can't nest rejection-query inside enumeration-query #21

longouyang opened this issue Oct 24, 2013 · 3 comments

Comments

@longouyang
Copy link
Member

This might be an FYI more than a real bug. Non-working code:

(define (f n)
  (rejection-query
   (define x (uniform-draw (list n (+ n 1) (+ n 2) (+ n 3) (+ n 4))))
   x

   (>= x 5)))

(enumeration-query
 (define n (uniform-draw (list 1 2 3)))

 (define y (f n))

 y

 true)

Of course, we could just make f an enumeration-query and use (apply multinomial (f n))

@ngoodman
Copy link
Contributor

Note: this is because rejectionSample in probjs is implemented in a way that makes a new trace object for each try, rather than staying within the enclosing trace. It could be done as an ordinary js helper function instead. It's not clear whether there are speed implications.

There is also some interaction with the (pending) fix to allow rejection to deal correctly with factor and directly conditioned ERPS.

@longouyang
Copy link
Member Author

Noah, what is the status on this? Did the possible interactions get resolved?

@ngoodman
Copy link
Contributor

i don’t think anyone went back to work on this / these issues.

-N

On Mar 28, 2014, at 6:31 PM, Long Ouyang [email protected] wrote:

Noah, what is the status on this? Did the possible interactions get resolved?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants