TuringLang / AdvancedHMC.jl

Robust, modular and efficient implementation of advanced Hamiltonian Monte Carlo algorithms
https://turinglang.org/AdvancedHMC.jl/
MIT License
237 stars 41 forks source link

support ComponentArrays #257

Closed scheidan closed 3 years ago

scheidan commented 3 years ago

Implements #253. Please let me know if I shoudl change something.

scheidan commented 3 years ago

Some CI tests failed but I think it has nothing to do with this commit. Unfortuantlay it says only This check failed when clicking on details...

Locally the tests pass.

xukai92 commented 3 years ago

Thanks for the PR. The proposed way to support ComponentArrays looks great to me. But the current implementation changes the interface, which is not desirable. Please check my comments on addressing this.

Also, can you add a test with the use case of ComponentArrays so that we know this PR works as expected? The example you have in https://github.com/TuringLang/AdvancedHMC.jl/issues/253 should be good enough. You should be able to add packages only for testing purposes in the [extras] section in the Project.toml file.

scheidan commented 3 years ago

Thanks for your review @xukai92! Your suggestion made a lot of sense.

xukai92 commented 3 years ago

Great! The changes look good to me. It's quite neat to have ComponentArray offically supported in AHMC. Thanks for the PR again!