-
Notifications
You must be signed in to change notification settings - Fork 234
breaking - v0.43 #2733
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
Merged
Merged
breaking - v0.43 #2733
Changes from 17 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
1d75f60
Bump minor version
penelopeysm 97059d3
Merge remote-tracking branch 'origin/main' into breaking
penelopeysm 63d8281
Merge branch 'main' into breaking
penelopeysm 0477b65
move stats.jl to separate file
penelopeysm 46b5373
[skip ci] Merge remote-tracking branch 'origin/main' into breaking
penelopeysm f7d878b
Optimisation interface rework (#2747)
penelopeysm 0059311
Export get_vector_params since it's useful
penelopeysm 4b3a969
Document
penelopeysm f6fcd2d
Merge branch 'main' into breaking
penelopeysm 8660a19
Merge branch 'main' into breaking
penelopeysm 19730fe
Seed a test properly
penelopeysm 2eb47a0
Merge branch 'main' into breaking
penelopeysm 22bcc2a
Run CI against new DPPL / VNT (#2756)
penelopeysm c2208e4
Merge branch 'main' into breaking
penelopeysm 0aad2b9
Merge remote-tracking branch 'origin/main' into breaking
penelopeysm fd3ab94
Changelog
penelopeysm 68ccbf3
fixes for densify
penelopeysm f9ee09f
fix gibbs tests
penelopeysm d79e8b7
Silence Aqua on `Libtask.might_produce`
penelopeysm 992efff
Remove size from LinkedVectorValue
penelopeysm ee4c4f2
Fix typo
penelopeysm 8442ce2
Add template to tilde_observe!!
penelopeysm c162b0a
Add isnan check to MH initialisation
penelopeysm 4ea8d8d
Add template to accumulate_observe!!
penelopeysm ad19711
Tell users about the proposals that are being used in MH (#2774)
penelopeysm 7e1f9bf
Add Logging test dep
penelopeysm 66e28d9
Fix test import
penelopeysm 948f09c
More imports...
penelopeysm dde2fc1
DPPL is released
penelopeysm 4c3d67c
Fix tests
penelopeysm 92b9c63
fix Enzyme project env
penelopeysm 6001b23
fix LinkedRW printing
penelopeysm 0cdbfe5
Implement checks for discrete variables with HMC
penelopeysm d743b4b
Merge branch 'main' into breaking
penelopeysm ac4c9df
Fix tests
penelopeysm 9fdd23f
Bump min DPPL
penelopeysm 3a834ea
Improve changelog
penelopeysm 772330a
Rename get_vector_params -> vector_names_and_params
penelopeysm f87f1fa
Rewrite optimisation docs
penelopeysm b8f7a2e
use VectorBijectors in optimisation
penelopeysm c5b1f72
use get_priors in ESS
penelopeysm 6f4a17c
point to DPPL branch
penelopeysm ff574e9
Squish more bugs
penelopeysm 2c24742
fix more things
penelopeysm de8655f
fix tests
penelopeysm 78b5aa3
Add a test for the LKJCholesky optimisation
penelopeysm f391102
some pMCMC docstrings
penelopeysm 51f5558
Clarify abstract type parameter
penelopeysm 8b8bc8d
Merge remote-tracking branch 'origin/main' into breaking
penelopeysm 1845c9a
tidy
penelopeysm c10ae92
fix vec
penelopeysm 8006bb7
Remove DistributionsAD
penelopeysm e0aae9f
fix import
penelopeysm 8b4170f
Fix imports
penelopeysm 01d5a4a
changelog
penelopeysm 8e0d448
Fix CI hang due to depwarn
penelopeysm 1369bf5
increase atol on PG tests
penelopeysm 427fab9
Update patch notes
penelopeysm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| using AbstractPPL: VarName | ||
| using DynamicPPL: DynamicPPL | ||
|
|
||
| # These functions are shared by both MCMC and optimisation, so has to exist outside of both. | ||
|
|
||
| """ | ||
| _convert_initial_params(initial_params) | ||
|
|
||
| Convert `initial_params` to a `DynamicPPl.AbstractInitStrategy` if it is not already one, or | ||
| throw a useful error message. | ||
| """ | ||
| _convert_initial_params(initial_params::DynamicPPL.AbstractInitStrategy) = initial_params | ||
| function _convert_initial_params(nt::NamedTuple) | ||
| @info "Using a NamedTuple for `initial_params` will be deprecated in a future release. Please use `InitFromParams(namedtuple)` instead." | ||
| return DynamicPPL.InitFromParams(nt) | ||
| end | ||
| function _convert_initial_params(d::AbstractDict{<:VarName}) | ||
| @info "Using a Dict for `initial_params` will be deprecated in a future release. Please use `InitFromParams(dict)` instead." | ||
| return DynamicPPL.InitFromParams(d) | ||
| end | ||
| function _convert_initial_params(::AbstractVector{<:Real}) | ||
| errmsg = "`initial_params` must be an `DynamicPPL.AbstractInitStrategy`. Using a vector of parameters for `initial_params` is no longer supported. Please see https://turinglang.org/docs/usage/sampling-options/#specifying-initial-parameters for details on how to update your code." | ||
| throw(ArgumentError(errmsg)) | ||
| end | ||
| function _convert_initial_params(@nospecialize(_::Any)) | ||
| errmsg = "`initial_params` must be a `DynamicPPL.AbstractInitStrategy`." | ||
| throw(ArgumentError(errmsg)) | ||
| end | ||
|
|
||
| # TODO: Implement additional checks for certain samplers, e.g. | ||
| # HMC not supporting discrete parameters. | ||
| function _check_model(model::DynamicPPL.Model) | ||
| return DynamicPPL.check_model(model; error_on_failure=true) | ||
| end | ||
| function _check_model(model::DynamicPPL.Model, ::AbstractMCMC.AbstractSampler) | ||
| return _check_model(model) | ||
| end | ||
|
|
||
| # Similar to InitFromParams, this is just for convenience | ||
| _to_varnamedtuple(nt::NamedTuple) = DynamicPPL.VarNamedTuple(nt) | ||
| _to_varnamedtuple(d::AbstractDict{<:VarName}) = DynamicPPL.VarNamedTuple(pairs(d)) | ||
| _to_varnamedtuple(vnt::DynamicPPL.VarNamedTuple) = vnt |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth pointing out either here or above at the beginning of these bullet points that this only applies when using indexing, and doing the multivariate distribution version of the below is entirely fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tweaked wording