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

initial_values: rename theta to flattened_param_vals #673

Merged

Conversation

vandenman
Copy link
Contributor

Fixes #672

@coveralls
Copy link

coveralls commented Sep 25, 2024

Pull Request Test Coverage Report for Build 11049838323

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 77.486%

Totals Coverage Status
Change from base Build 10992907511: 0.0%
Covered Lines: 2712
Relevant Lines: 3500

💛 - Coveralls

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.22%. Comparing base (ad88334) to head (0a4e298).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #673      +/-   ##
==========================================
- Coverage   75.93%   75.22%   -0.71%     
==========================================
  Files          29       29              
  Lines        3519     3266     -253     
==========================================
- Hits         2672     2457     -215     
+ Misses        847      809      -38     
Flag Coverage Δ
75.22% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@torfjelde
Copy link
Member

Lovely! Thank you @vandenman!

Could you also add a test here:

# specify `initial_params=nothing`
Random.seed!(1234)
chain1 = sample(model, sampler, 1; progress=false)
Random.seed!(1234)
chain2 = sample(model, sampler, 1; initial_params=nothing, progress=false)

Should be sufficient to just add a line of the form

@test_throws DimensionMismatch sample(model, sampler, 1; progress=false, initial_params=zeros(10))

to make sure that we're correctly throwing an error in the case of incorrect lengths:)

Once that's done, I'll hit the big green button:)

(I would have made a Github suggestion but unfortunately can't do that to files that are not altered in the PR)

@vandenman
Copy link
Contributor Author

@torfjelde no problem, let me know if there is anything else!

test/sampler.jl Outdated Show resolved Hide resolved
Copy link
Member

@torfjelde torfjelde left a comment

Choose a reason for hiding this comment

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

Lovely; thank you @vandenman !

There was a minor formatting issue that I just fixed 👍

Approved and scheduled it to "merge when ready" i.e. once test suite passes! Appreciate your contribution:)

@torfjelde torfjelde enabled auto-merge September 26, 2024 09:52
@torfjelde torfjelde added this pull request to the merge queue Sep 26, 2024
Merged via the queue into TuringLang:master with commit 96a3150 Sep 26, 2024
10 of 11 checks passed
@vandenman vandenman deleted the fix_initial_params_undefvarerror branch September 26, 2024 17:53
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.

initial_params with wrong length throws UndefVarError: theta not defined` while trying to show an error
3 participants