Skip to content

Commit

Permalink
Merge pull request #26 from tpapp/tp/treedepth
Browse files Browse the repository at this point in the history
Make maximum depth a constant, increase it.
  • Loading branch information
tpapp authored Nov 27, 2018
2 parents dba96d3 + b4df26e commit 45138ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name = "DynamicHMC"
uuid = "bbc10e6e-7c05-544b-b16e-64fede858acb"
authors = ["Tamas K. Papp <[email protected]>"]
version = "1.0.2"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
5 changes: 4 additions & 1 deletion src/sampler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Covariance matrix of the sample.
"""
sample_cov(sample) = cov(get_position_matrix(sample); dims = 1)

"Default maximum depth for trees."
const MAX_DEPTH = 10

"""
$(SIGNATURES)
Expand Down Expand Up @@ -123,7 +126,7 @@ function NUTS_init(rng::AbstractRNG, ℓ::AbstractLogDensityProblem;
q = randn(rng, dimension(ℓ)),
κ = GaussianKE(dimension(ℓ)),
p = rand(rng, κ),
max_depth = 5,
max_depth = MAX_DEPTH,
ϵ = InitialStepsizeSearch(),
report = ReportIO())
H = Hamiltonian(ℓ, κ)
Expand Down

0 comments on commit 45138ad

Please sign in to comment.