-
Notifications
You must be signed in to change notification settings - Fork 27
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
Attempt at implementation of VarNameVector
(Metadata
alternative)
#555
Open
torfjelde
wants to merge
196
commits into
master
Choose a base branch
from
torfjelde/varnamevector
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 187 commits
Commits
Show all changes
196 commits
Select commit
Hold shift + click to select a range
5af1afa
initial implementation of VarNameVector
torfjelde 8ce53f7
added some hacky getval and getdist get things to work for VarInfo
torfjelde fc6a051
Apply suggestions from code review
torfjelde 7cd599d
added arbitrary metadata field as discussed
torfjelde ed0a757
renamed idcs to varname_to_index
torfjelde 4ebd252
renamed vns to varnames for VarNameVector
torfjelde 9f12c9a
added keys impl for Metadata
torfjelde 5a15121
added push! and update! for VarNameVector
torfjelde edde2c1
added getindex_raw! and setindex_raw! for VarNameVector
torfjelde ed46002
added `iterate` and `convert` (for `AbstractDict) impls for `VarNameV…
torfjelde 5b00059
make the key and eltype part of the `VarNameVector` type
torfjelde bef7e0a
added more tests for VarNameVector
torfjelde 006ee8d
formatting
torfjelde 9802811
more testing for VarNameVector
torfjelde 88b1721
minor changes to some comments
torfjelde ca7b173
added a bunch more tests for VarNameVector + several bugfixes in the …
torfjelde fb01b94
formatting
torfjelde 9634839
added `similar` implementation for `VarNameVector`
torfjelde 5179f6f
formatting
torfjelde 9f632bb
removed debug statement
torfjelde 3c210f7
made VarInfo slighly more generic wrt. underlying metadata
torfjelde 8bf6589
Merge branch 'master' into torfjelde/varnamevector
torfjelde 8b2720f
fixed incorrect behavior in `keys` for `Metadata`
torfjelde 9fa6446
minor style changes to VarNameVector tests
torfjelde 0900c57
style
torfjelde 1f7e633
added testing of `update!` with smaller sizes and fixed bug related t…
torfjelde 8d05586
formatting
torfjelde 7801fe1
move functionality related to `push!` for `VarNameVector` into `push!`
torfjelde cdc2373
Update src/varnamevector.jl
torfjelde d2d776d
Merge branch 'master' into torfjelde/varnamevector
torfjelde ae4bcb7
several fixes to make sampling with VarNameVector + initiall tests for
torfjelde 97e1bcc
VarInfo + VarNameVector tests for all demo models
torfjelde be3c1b4
Merge remote-tracking branch 'origin/torfjelde/varnamevector' into to…
torfjelde ad343f3
Apply suggestions from code review
torfjelde f707b25
added docs on the design of `VarNameVector`
torfjelde 4e7af1d
Merge branch 'master' into torfjelde/varnamevector
torfjelde f1faf18
Apply suggestions from code review
torfjelde 87d3d01
added note on `update!`
torfjelde 9c3b265
further elaboration of the design of `VarInfo` and `VarNameVector`
torfjelde 958c66b
more writing improvements
torfjelde 74c6efd
added docstring to `has_inactive_ranges` and `inactive_ranges_sweep!`
torfjelde d9ea878
moved docs on `VarInfo` design to a separate internals section
torfjelde 5acce98
writing improvements for internal docs
torfjelde 6f95cdd
further motivation of the design choices made in `VarNameVector`
torfjelde 38a4b08
improved writing
torfjelde 60edd10
VarNameVector is now grown as much as needed
torfjelde 3f9d34f
updated `delete!`
torfjelde fb822b5
Significant changes to implementation of `VarNameVector`:
torfjelde 66bc090
added `copy` when constructing `VectorVarInfo` from `VarInfo`
torfjelde ccd86f2
added missing `isempty` impl
torfjelde 1d4a000
remove impl of `iterate` and instead implemented `pairs` and `values`…
torfjelde 9a16dd1
added missing `empty!` for `num_inactive`
torfjelde e49b762
removed redundant `shift_left!` methd
torfjelde 2b445c9
fixed `delete!` for `VarNameVector`
torfjelde e3c2633
added `is_contiguous` as an alterantive to `!has_inactive`
torfjelde 19a829c
updates to internal docs
torfjelde a358bc4
renamed `sweep_inactive_ranges!` to `contiguify!`
torfjelde 46be8d5
improvements to internal docs
torfjelde 57d688e
more improvements to internal docs
torfjelde 0968a07
moved additional methods description in internals to earlier in the doc
torfjelde 0d008a4
moved internals docs to a separate directory and split into files
torfjelde ccd0d64
more improvements to internals doc
torfjelde 7c45e67
formatting
torfjelde 373215b
added tests for `delete!` and fixed reference to old method
torfjelde 0cdafbf
addition to `delete!` test
torfjelde 51c041f
added `values_as` impls for `VarNameVector`
torfjelde 20b3742
added docs for `replace_valus` and `values_as` for `VarNameVector`
torfjelde ef6c618
fixed doctest
torfjelde 8a1209c
formatting
torfjelde adeadf0
temporarily disable doctests so we can build docs
torfjelde 7ff179d
added missing compat entry for ForwardDiff in docs
torfjelde c7ec08a
moved some shared code into methods to make things a bit cleaner
torfjelde c5a5e58
added impl of `merge` for `VarNameVector`
torfjelde c376d95
renamed a few variables in `merge` impl for `VarNameVector`
torfjelde f71baa5
forgot to include some changes in previous commit
torfjelde af25f3c
added impl of `subset` for `VarNameVector`
torfjelde c28f076
fixed `pairs` impl for `VarNameVector`
torfjelde f5d2c63
added missing impl of `subset` for `VectorVarInfo`
torfjelde 3eb6c7f
added missing impl of `merge_metadata` for `VarNameVector`
torfjelde 9ba8144
added a bunch of `from_vec_transform` and `tovec` impls to make
torfjelde acd6951
make default args use `from_vec_transform` rather than `FromVec`
torfjelde 790f743
fixed `values_as` fro `VarInfo` with `VarNameVector` as `metadata`
torfjelde c474bb0
fixed impl of `getindex_raw` when using integer index for `VarNameVec…
torfjelde 8251463
added tests for `getindex` with `Int` index for `VarNameVector`
torfjelde 5df7031
fix for `setindex!` and `setindex_raw!` for `VarNameVector`
torfjelde 683b776
introduction of `from_vec_transform` and `tovec` and its usage in `Va…
torfjelde 4dae00d
moved definition of `is_splat_symbol` to the file where it's used
torfjelde e3b52a4
added `VarInfo` constructor with vector input for `VectorVarInfo`
torfjelde 9626be1
make `extract_priors` take the `rng` as an argument
torfjelde e731fd6
added `replace_values` for `Metadata`
torfjelde 0785abf
make link and invlink act on the `metadata` field for `VarInfo` +
torfjelde b3e0955
added temporary defs of `with_logabsdet_jacobian` and `inverse` for
torfjelde ff963ce
added invlink_with_logpdf overload for `ThreadSafeVarInfo`
torfjelde 03f2b2b
added `is_transformed` field to `VarNameVector`
torfjelde 949b33a
removed unnecessary defintions of `with_logabsdet_jacobian` and
torfjelde cc5ecc4
fixed issue where we were storing the wrong transformations in `VarNa…
torfjelde 1aae1b4
make sure `extract_priors` doesn't mutate the `varinfo`
torfjelde 8e0853d
updated `similar` for `VarNameVector` and fixed `invlink` for `VarNam…
torfjelde 229b168
added handling of `is_transformed` in `merge` for `VarNameVector`
torfjelde c581dcf
removed unnecesasry `deepcopy` from outer `link`
torfjelde b4d3f55
updated `push!` to also `push!` on `is_transformed`
torfjelde ed1d006
skip tests for mutating linking when using VarNameVector
torfjelde f132209
use same projection for `Cholesky` in `VarNameVector` as in `VarInfo`
torfjelde 49454de
fixed `settrans!!` for `VarInfo` with `VarNameVector`
torfjelde 01ff2dd
fixed bug in `set_flag!`
torfjelde 20adedf
fixed another typo
torfjelde 8f9566a
fixed return values of `settrans!!`
torfjelde 5532046
updated static transformation tests
torfjelde 3c5d2ac
Update test/simple_varinfo.jl
torfjelde 317d969
Merge branch 'master' into torfjelde/varnamevector
torfjelde f8441ea
Merge remote-tracking branch 'origin/torfjelde/varnamevector' into to…
torfjelde ab16323
Merge branch 'master' into torfjelde/varnamevector
torfjelde a9be219
removed unnecessary impl of `extract_priors`
torfjelde 53c8d33
make `short_varinfo_name` of `TypedVarInfo` a bit more informative
torfjelde 61d85ad
moved impl of `has_varnamevector` for `ThreadSafeVarInfo`
torfjelde 9ace554
added back `extract_priors` impl as we do need it
torfjelde 67c9821
forgot to include tests for `VarNameVector` in `runtests.jl`
torfjelde 32a2d31
fix for `relax_container_types` in `test/varnamevector.jl`
torfjelde b3bb42d
fixed `need_transforms_relaxation`
torfjelde 25ff2b1
updated some tests to not refer directly to `FromVec`
torfjelde 004f038
introduce `from_internal_transform` and its siblings
torfjelde 38c89bd
remove `with_logabsdet_jacobian_and_reconstruct` in favour of
torfjelde 218dc23
added `internal_to_linked_internal_transform` + fixed a few bugs in
torfjelde 1df4293
added `linked_internal_to_internal_transform` as a complement to `int…
torfjelde f8df896
fixed bugs in `invlink` for `VarInfo` using `linked_internal_to_inter…
torfjelde d62f26a
more work on removing calls to `reconstruct`
torfjelde b4517d6
removed redundant comment
torfjelde b7d4754
added `from_linked_vec_transform` specialization for `LKJ`
torfjelde 0244dd9
more work on removing references to `reconstruct`
torfjelde e886d07
added `copy` in `values_from_metadata` to preserve behavior and avoid
torfjelde 2af6605
remove `reconstruct_and_link` and `invlink_and_reconstruct`
torfjelde a0664d7
replaced references to `link_and_reconstruct` and `invlink_and_recons…
torfjelde f2d59b2
introduced `recombine` and replaced calls to `reconstruct` with `n` s…
torfjelde e3bfa76
completely removed `reconstruct`
torfjelde c0aef81
renamed `maybe_reconstruct_and_link` to `to_maybe_linked_internal` and
torfjelde f7c0853
added impls of `from_*_internal_transform` for `ThreadSafeVarInfo`
torfjelde 77b835e
removed `reconstruct` from docs and from exports
torfjelde b83c262
renamed `getval` to `getindex_internal` and made `dist` an optional
torfjelde c4faf3e
updated docs + added description of how internals of transforms work
torfjelde c8d9695
added a bunch of illustrations for the transforms docs + dot files us…
torfjelde 95dc8e3
temporarily removed `VarNameVector` completely
torfjelde 8930f9c
formatting
torfjelde e45b668
Update docs/src/internals/transformations.md
torfjelde 0e71092
Update docs/src/internals/transformations.md
torfjelde 2de9ac9
removed refs to VectorVarInfo
torfjelde 9b71428
added impls of `from_internal_transform` for `ThreadSafeVarInfo`
torfjelde 786e9bf
reverted accidental removal of old `VarInfo` constructor
torfjelde f1fe42c
fixed incorrect `recombine` call
torfjelde 2273954
removed undefined refs to `VarNameVector` stuff in `setup_varinfos`
torfjelde ab7c189
bump minior version because Turing breaks
torfjelde 3a86601
fix: was using `from_linked_internal_transform` in
torfjelde 28c7d85
removed `getindex_raw`
torfjelde 59514d6
removed redundant docstrings
torfjelde cdc882b
fixed tests
torfjelde 57ba7c0
fixed comparisons in tests
torfjelde 902e59c
try relative references for images in transformation docs
torfjelde d7aba55
another attempt at fixing asset-references
torfjelde b0dd2f8
Merge branch 'master' into torfjelde/transformations
torfjelde 1f51203
fixed getindex diagrams in docs
torfjelde 0eb79b1
minor changes to comments
torfjelde 071bebf
remove Combinatorics as a test dep, as it's not needed for this PR
torfjelde bbdc060
reverted unnecessary change
torfjelde e2f4d18
disable type-stability tests for models on older Julia versions
torfjelde 3d823ac
removed seemingly completely unused impl of `setval!`
torfjelde 54792f4
Revert "temporarily removed `VarNameVector` completely"
torfjelde ff68206
Revert "remove Combinatorics as a test dep, as it's not needed for th…
torfjelde 9b1014d
Merge remote-tracking branch 'origin/master' into torfjelde/varnameve…
mhauru 19978ec
More work on `VarNameVector` (#637)
mhauru 95668eb
Merge remote-tracking branch 'origin/master' into torfjelde/varnameve…
mhauru 1e4efe6
Bump Bijectors dependecy
mhauru 3ee9832
Remove dead TODO note
mhauru 26753e9
Remove old TODOs, improve VNV invlinking
mhauru ea18e1f
Fix from_vec_transform for 0-dim arrays
mhauru ffbf2ad
Fix unflatten for VarInfo
mhauru f077f4a
Fix some VarInfo index getters
mhauru e27af80
Change how VNV handles transformations, and other VNV stuff
mhauru b5677b4
Small docs fixes
mhauru 9d1c8d3
Merge remote-tracking branch 'origin/master' into torfjelde/varnameve…
mhauru b778082
Small fixes all over for VNV
mhauru 9750e60
Add comments
mhauru 9ecc506
Fix some tests
mhauru 3f1b9a2
Change long string formatting to support Julia 1.6
mhauru 9145965
Small changes to ReshapeTransformation
mhauru 937956d
Revert unrelated changes to ReverseDiff extension
mhauru 4fbe5d2
Improve VarNamedVector VarInfo testing
mhauru 9f11e7b
Fix some depwarns
mhauru 86d97ae
Improvements to test/simple_varinfo.jl
mhauru 2535517
Fix for unset_flag!, better docstring
mhauru 93ef3ee
Add a comment about hasvalue/getvalue
mhauru f35eca6
Add @non_differentiable calls to work around Zygote limitations
mhauru d55fc00
Fix docs, workaround Zygote issue
mhauru 5bbba91
Remove outdated workaround
mhauru 851630f
Move has_varnamedvector(varinfo::VarInfo) to abstract_varinfo.jl
mhauru 45c89c4
Make copies of logp and num_produce in subset
mhauru 30252dc
Rename getindex_raw to getindex_internal
mhauru be77c36
Add push!(::VarNamedVector, ::Pair)
mhauru 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
There are no files selected for viewing
This file contains 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 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
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.
This method claimed to work for
AbstactChains
, but in fact only worked forMCMCChains
. Hence I moved it to the MCMCChains extension as I refactored this function to work with VarNamedVectors.