Skip to content

Add sig_figs option for log_prob.#692

Merged
WardBrian merged 3 commits intostan-dev:developfrom
tillahoffmann:log-prob-sig-figs
Sep 6, 2023
Merged

Add sig_figs option for log_prob.#692
WardBrian merged 3 commits intostan-dev:developfrom
tillahoffmann:log-prob-sig-figs

Conversation

@tillahoffmann
Copy link
Copy Markdown
Contributor

@tillahoffmann tillahoffmann commented Sep 6, 2023

Submission Checklist

  • Run unit tests
  • Declare copyright holder and open-source license: see below

Summary

Add sig_figs option to the log_prob method, e.g., for checking manual gradients to higher precision. I have added tests that compare with a literal string of the expected digits because estimating the number of digits from a float can be fiddly.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Harvard University

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

Copy link
Copy Markdown
Member

@WardBrian WardBrian left a comment

Choose a reason for hiding this comment

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

Thanks, this being missing was definitely an oversight.

A couple (small) things:

Comment thread cmdstanpy/model.py Outdated
Comment thread test/test_log_prob.py Outdated
@tillahoffmann
Copy link
Copy Markdown
Contributor Author

Thanks for the speedy input. It looks like there's something up with the cached precompiled header, but I couldn't figure out the root cause.

@WardBrian
Copy link
Copy Markdown
Member

Yeah, I think we want to delete the cached precompiled header each time. I made the change here: 4bc77be in #691

It's odd this wasn't an issue until a couple weeks ago I first noticed it with the github runners.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 6, 2023

Codecov Report

Merging #692 (6365fda) into develop (b5d7484) will decrease coverage by 0.13%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop     #692      +/-   ##
===========================================
- Coverage    80.03%   79.90%   -0.13%     
===========================================
  Files           72       48      -24     
  Lines        10962     7312    -3650     
===========================================
- Hits          8773     5843    -2930     
+ Misses        2189     1469     -720     

see 26 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@WardBrian WardBrian merged commit 2d54607 into stan-dev:develop Sep 6, 2023
@tillahoffmann tillahoffmann deleted the log-prob-sig-figs branch October 23, 2023 21:55
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.

3 participants