-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
i think there may be a bug, or at least questionable choice in the semantics of mem. consider:
Infer({method: 'rejection', samples: 100}, function() {
var memfn = mem(function(buttons) {return uniform(0,1)})
// memfn('a');
var inner = Infer({method: 'rejection', samples: 100}, function() {
var p = memfn('a')
condition(flip(p))
return flip(p)
})
return sample(inner)
})
different results are obtained if the memfn('a'); line is uncommented. it does not seem to me like this should happen.
the semantics we converged on for mem in Church was that all of the random sampling (for all inputs to the function) was to be considered as happening where the memoized function was created, even if the sampling was deferred in practice. in webppl it seems that we are breaking this convention, at least when a memoized function crosses an Infer boundary.
(this bug came to light in probmods/probmods2#56)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels