blackjax-devs / blackjax

BlackJAX is a Bayesian Inference library designed for ease of use, speed and modularity.
https://blackjax-devs.github.io/blackjax/
Apache License 2.0
806 stars 105 forks source link

Alignment test #630

Closed reubenharry closed 9 months ago

reubenharry commented 9 months ago

Reopening this PR, but now the tests are in a misc. Note that changes were made to run_inference_algorithm, in order to allow manually specification of seeds.

reubenharry commented 9 months ago

OK, I can work on that. I agree that the same seed shouldn't be used, but would it be reasonable to let the user manually choose the keys? (instead of providing a fixed seed)?

And why an ipynb, not a py file?

junpenglao commented 9 months ago

OK, I can work on that. I agree that the same seed shouldn't be used, but would it be reasonable to let the user manually choose the keys? (instead of providing a fixed seed)?

I dont see a valid use case for that, user are manually choosing the seed since Jax seeding is stateless, and the seed splitting is completely deterministic.

We do have one similar alignment test in blackjax, in case you want to take a lookt: https://github.com/blackjax-devs/blackjax/blob/7499bfd1a5bb4276ad84390598092c5d1fef8e51/tests/mcmc/test_trajectory.py#L77

it is comparing the iterative trajectory building with the recursive trajectory building. Note how to make sure both algorithm is using the same RNG_key, it is called in a for loop using the inner function.

And why an ipynb, not a py file?

I think it is easier for the float64 setting