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

update pathfinder args for psis_resample and lp_calculate #903

Merged
merged 7 commits into from
Jan 26, 2024

Conversation

SteveBronder
Copy link
Collaborator

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Adds the psis_resample and calculate_lp arguments to pathfinder

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):
Simons Foundation

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

@avehtari
Copy link
Contributor

There is a confusing warning after running with psis_resample=FALSE

> pth6 <- model6$pathfinder(data = standata6, init=0.1, num_paths=10, single_path_draws=40,
                          history_size=50, max_lbfgs_iters=100, psis_resample=FALSE)
> pdraws6 <- pth6$draws()
Warning message:
In read_csv_metadata(output_file) : NAs introduced by coercion

@avehtari
Copy link
Contributor

avehtari commented Jan 21, 2024

The returned number of draws per path is always at least 25

> pth8rhs <- model8rhs$pathfinder(data = standata8, init=0.1,
                                num_threads=1,
                                num_paths=1, single_path_draws=10, draws=10,
                                history_size=50, max_lbfgs_iters=100,
                                psis_resample=FALSE)
> ndraws(pth8rhs$draws())
25

The returned number of draws should be what the user asks

EDIT: I guess this is CmdStan/Stan bug, but reported now here as part of my testing

@avehtari
Copy link
Contributor

lp_calculate=FALSE seems to work in a sense that I see NaN's, but surprisingly I don't see any performance difference with Birthdays models. I guess I need to test with a bigger data.

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cd7b94b) 88.28% compared to head (bc0f18a) 88.32%.

❗ Current head bc0f18a differs from pull request most recent head 89c3375. Consider uploading reports for the commit 89c3375 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #903      +/-   ##
==========================================
+ Coverage   88.28%   88.32%   +0.03%     
==========================================
  Files          12       12              
  Lines        4534     4548      +14     
==========================================
+ Hits         4003     4017      +14     
  Misses        531      531              

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

@SteveBronder SteveBronder merged commit d3b455f into master Jan 26, 2024
12 checks passed
@jgabry jgabry deleted the feature/update-pathfinder-args branch January 29, 2024 17:34
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.

5 participants