Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements Barker's proposal. #596

Merged
merged 7 commits into from
Dec 1, 2023
Merged

Implements Barker's proposal. #596

merged 7 commits into from
Dec 1, 2023

Conversation

AdrienCorenflos
Copy link
Contributor

Thank you for opening a PR!

A few important guidelines and requirements before we can merge your PR:

  • [Y] If I add a new sampler, there is an issue discussing it already;
  • [Y] We should be able to understand what the PR does from its title only;
  • [Y] There is a high-level description of the changes;
  • [Y] There are links to all the relevant issues, discussions and PRs;
  • [Y] The branch is rebased on the latest main commit;
  • [Y] Commit messages follow these guidelines;
  • [Y] The code respects the current naming conventions;
  • [Y] Docstrings follow the numpy style guide
  • [Y] pre-commit is installed and configured on your machine, and you ran it before opening the PR;
  • [Y] There are tests covering the changes;
  • [Y] The doc is up-to-date;
  • [N] If I add a new sampler* I added/updated related examples

Consider opening a Draft PR if your work is still in progress but you would like some feedback from other contributors.

This implements #208

The sampler is tested against the suite of toy examples + the proposal is tested against its PDF. I don't have time to implement an example (also btw, the link in the PR guidelines for the example does not work).

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9713452) 99.11% compared to head (6a78744) 99.14%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #596      +/-   ##
==========================================
+ Coverage   99.11%   99.14%   +0.02%     
==========================================
  Files          50       51       +1     
  Lines        2255     2329      +74     
==========================================
+ Hits         2235     2309      +74     
  Misses         20       20              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@junpenglao junpenglao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I will need a bit more time on the main implementation itself, so just sending a first round of quick comments.

tests/mcmc/test_barker.py Outdated Show resolved Hide resolved
tests/mcmc/test_sampling.py Outdated Show resolved Hide resolved
blackjax/mcmc/barker.py Outdated Show resolved Hide resolved
@AdrienCorenflos
Copy link
Contributor Author

Great work! I will need a bit more time on the main implementation itself, so just sending a first round of quick comments.

Yeah, I had left it open for a while because I thought it was a great entry point for newcomers, but then nobody picked it in over a year so...

blackjax/mcmc/barker.py Show resolved Hide resolved
blackjax/mcmc/barker.py Outdated Show resolved Hide resolved
blackjax/mcmc/barker.py Outdated Show resolved Hide resolved
tests/mcmc/test_sampling.py Outdated Show resolved Hide resolved
blackjax/mcmc/barker.py Outdated Show resolved Hide resolved
blackjax/mcmc/barker.py Outdated Show resolved Hide resolved
@junpenglao junpenglao merged commit ece6861 into blackjax-devs:main Dec 1, 2023
7 checks passed
@junpenglao
Copy link
Member

Thanks!!

junpenglao added a commit that referenced this pull request Mar 12, 2024
* Implements Barker's proposal.

* Implement cosmetic fixed

* Update tests/mcmc/test_sampling.py

Co-authored-by: Junpeng Lao <[email protected]>

* Still cosmetic fixed as suggested by Junpeng

* Update blackjax/mcmc/barker.py

Co-authored-by: Junpeng Lao <[email protected]>

* Still cosmetic fixes as suggested by Junpeng

* test failed due to numerical precision. Changing the step size to a better value fixed it.

---------

Co-authored-by: Junpeng Lao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants