webppl icon indicating copy to clipboard operation
webppl copied to clipboard

Probabilistic programming for the web

Results 103 webppl issues
Sort by recently updated
recently updated
newest added

I use webppl pretty regularly currently to learn how to do bayesian inference, and I notice that some distributions are missing that are in other offerings like pyMC3. One particular...

It would be convenient to support [ES6 default parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters) in WebPPL. So `function(x){var x = (x=='undefined' ? 1 : x);...}` becomes `function(x=1){...}`. This could happen with #2, if we ever...

We rely on Node's [custom inspect method](https://nodejs.org/dist/latest-v10.x/docs/api/util.html#util_custom_inspection_functions_on_objects) mechanism to pretty print distributions, but it looks like this stopped working since around Node v12. The most noticeable effect of this is...

bug

This was [reported](https://groups.google.com/forum/#!topic/webppl-dev/pVi--qNv2VE) on the mailing list. I suspect this happens because the parser is doing something like the following: Both `var` and `let` are represented as similar "variable declaration"...

bug

Suppose you use Enumerate to create an erp with objects in its support: ``` var uniformDraw = function (xs) { return xs[randomInteger(xs.length)]; }; var myERP = Enumerate(function(){ return uniformDraw([{'a' :...

``` var P = function() { return flip(theta) ? 'a' : 'b'; } var fn = function() { return sample(Beta({a: 1, b: 1})) } //var x = sample(Beta({a: 1, b:...

bug

[`expectation`](https://github.com/probmods/webppl/blob/9e4d473f51d67d860284c4a9b1b9226b7af978ab/src/header.wppl#L136) assumes that its argument's support is over JS numbers. We might consider generalising this to also support tensors. (via this [mailing list thread](https://groups.google.com/forum/#!topic/webppl-dev/Q_dC6j8MeNk).)

enhancement

At present: `Enumerate(function() { flip(0.5) ? -Infinity : Infinity }).support(); === [ -Infinity ]` Rather than `[ -Infinity, Infinity]`. This happens because in building the histogram `JSON.stringify(Infinity) === JSON.stringify(-Infinity) ===...

Since #905 was merged, we are storing the score of each individual choice/sample as part of the trace. (See [here](https://github.com/probmods/webppl/blob/9e4d473f51d67d860284c4a9b1b9226b7af978ab/src/trace.js#L72).) It looks like we can re-use these (rather than re-scoring)...

Making the whole thing available makes it very easy for new users to shoot themselves in the foot. We might avoid this by only exposing the bits that work. We'd...