rlouf / mcx

Express & compile probabilistic programs for performant inference on CPU & GPU. Powered by JAX.
https://rlouf.github.io/mcx
Apache License 2.0
325 stars 17 forks source link

fix bug in README example #60

Closed jeremiecoullon closed 3 years ago

jeremiecoullon commented 3 years ago

Readme example fix:

• fixed a bug in the linear_regression function (I simply used the function in the tests) • Added synthetic data so the example is self contained (I also used the data in the tests)

rlouf commented 3 years ago

Thanks, that's going to be the most run piece of code in the library so that's very useful :)

Since it is a simple example in the readme, I am now wondering if we should condense it a little? Like:

observations = {
   'x_data': onp.random.normal(0, 5, size=1000).reshape(-1, 1),
   'y_data' = 3 * x_data + onp.random.normal(size=x_data.shape),
   'lmbda' = 3
}

What do you think?

jeremiecoullon commented 3 years ago

That's better! I'll fix it later today

jeremiecoullon commented 3 years ago

Condensed it a bit; feel free to modify if you'd like :)

rlouf commented 3 years ago

Thank you! Merging.