Skip to content

Commit

Permalink
Merge pull request #744 from null-a/drift-test
Browse files Browse the repository at this point in the history
Add regression test for issue 147.
  • Loading branch information
stuhlmueller committed Jan 3, 2017
2 parents e81328b + a5f26e8 commit 96c8791
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test-data/stochastic/expected/funnyDrift.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hist": {
"true": 0.5,
"false": 0.5
}
}
11 changes: 11 additions & 0 deletions tests/test-data/stochastic/models/funnyDrift.wppl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Test for the problem described in issue 147.
var model = function() {
if (flip()) {
sample(Gaussian({mu: 0, sigma: 2}), {
driftKernel(prevVal) { return Gaussian({mu: 100, sigma: 1}); }
});
return true;
} else {
return false;
}
};
1 change: 1 addition & 0 deletions tests/test-inference.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ var tests = [
std: { tol: 0.4 },
args: { samples: 200000, burn: 1 }
},
funnyDrift: true,
withCaching: true,
variableSupport: true,
query: true,
Expand Down

0 comments on commit 96c8791

Please sign in to comment.