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 no-U-turn criteria and added some unit tests #91

Merged
merged 51 commits into from
Aug 19, 2019
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
231b36e
add mv gass test for preconditioner #25
xukai92 Aug 16, 2019
4db2ebd
implement an interface to support multiple termination criteria
xukai92 Aug 16, 2019
0743e1a
add some unit tests for different metrics
xukai92 Aug 16, 2019
bd2ba31
bugfix
xukai92 Aug 16, 2019
d6aeedc
tiny up comments
xukai92 Aug 16, 2019
519688d
add test for tree sampler
xukai92 Aug 16, 2019
46d0b6d
add generalised u-turn (buggy)
xukai92 Aug 17, 2019
6c511a9
refactor transition using FullBinaryTree
xukai92 Aug 17, 2019
59035f4
add test for termination criteria
xukai92 Aug 17, 2019
ab52bcd
add test for termination
xukai92 Aug 17, 2019
32ea1e7
warn full binary tree is not tested
xukai92 Aug 17, 2019
4df7b03
fix u-turn bug and improve numerical stability
xukai92 Aug 17, 2019
054487a
change default to generalised
xukai92 Aug 17, 2019
2d69b5a
clean up isturn
xukai92 Aug 18, 2019
560f8c9
fix typo
xukai92 Aug 18, 2019
3374cba
fix the tree depth shift bug
xukai92 Aug 18, 2019
bc9b55e
remove old tests
xukai92 Aug 18, 2019
5054081
remove symbol iniitalisation of NUTS
xukai92 Aug 18, 2019
a31f9ca
implement show for different NUTS types
xukai92 Aug 18, 2019
acad240
rename isturn to isterminated
xukai92 Aug 18, 2019
c09c8bb
move termination out of tree
xukai92 Aug 18, 2019
a41d453
simplify new interface
xukai92 Aug 18, 2019
1c24459
seperate zcand and sampler from tree
xukai92 Aug 18, 2019
0c48a25
remove non-necessary energy argument
xukai92 Aug 18, 2019
d347342
fix typo
xukai92 Aug 18, 2019
0e7f13e
fix broken tests
xukai92 Aug 18, 2019
a69f8ad
add test for no U-turn
xukai92 Aug 18, 2019
6ab2d9c
update interface and test for full binary tree
xukai92 Aug 18, 2019
8baf321
improve test script
xukai92 Aug 18, 2019
4215b40
fix u-turn and improve tests
xukai92 Aug 18, 2019
2bde38f
clean up code
xukai92 Aug 19, 2019
bf287f9
disable test for original no-U-turn
xukai92 Aug 19, 2019
f84c3aa
fix original u-turn logic and test
xukai92 Aug 19, 2019
aaa24b0
update demo and inc version number
xukai92 Aug 19, 2019
0fa523e
renmae XTreeSampler to XTrajectorySampler
xukai92 Aug 19, 2019
f3eab50
logu -> ℓu
xukai92 Aug 19, 2019
4036eee
logw -> ℓw
xukai92 Aug 19, 2019
35dff6d
update comments
xukai92 Aug 19, 2019
e66f628
NoUTurn -> ClassicNoUTurn
xukai92 Aug 19, 2019
c4e4b44
update type signature for GeneralisedNoUTurn
xukai92 Aug 19, 2019
39dd7c5
remove unused type in isterminated
xukai92 Aug 19, 2019
30c40a5
improve naming in isterminated for ClassicNoUTurn
xukai92 Aug 19, 2019
89ba82b
t -> tree
xukai92 Aug 19, 2019
866c901
improve code of mh_accept for multinomial sampling
xukai92 Aug 19, 2019
345cdec
FullBinaryTree -> BinaryTree
xukai92 Aug 19, 2019
b62e322
remove duplicate word for
xukai92 Aug 19, 2019
134e43b
fix type bug
xukai92 Aug 19, 2019
e07520e
fix unchanged tree sampler names
xukai92 Aug 19, 2019
0a09e1a
fix unchanged tree sampler names
xukai92 Aug 19, 2019
bd7af6b
α -> sum_α
xukai92 Aug 19, 2019
15c254d
?TrajctorySampler -> ?
xukai92 Aug 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/trajectory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ SliceTreeSampler(rng::AbstractRNG, z0::PhasePoint) = SliceTreeSampler(z0, log(ra

"""
Multinomial sampler for the starting single leaf tree.
Tree weight is the (unnormalised) energy of the leaf.
(Log) weights for leaf nodes are their (unnormalised) Hamiltonian energies.

Ref: https://github.com/stan-dev/stan/blob/develop/src/stan/mcmc/hmc/nuts/base_nuts.hpp#L226
"""
Expand All @@ -144,7 +144,7 @@ SliceTreeSampler(s::SliceTreeSampler, H0::AbstractFloat, zcand::PhasePoint) =
SliceTreeSampler(zcand, s.ℓu, (s.ℓu <= -energy(zcand)) ? 1 : 0)

"""
Multinomial sampler for the starting single leaf tree.
Multinomial sampler for for a trajectory consisting only a leaf node.
xukai92 marked this conversation as resolved.
Show resolved Hide resolved
- tree weight is the (unnormalised) energy of the leaf.
"""
MultinomialTrajectorySampler(s::MultinomialTrajectorySampler, H0::AbstractFloat, zcand::PhasePoint) =
Expand Down