You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this has been reported. Setting n_samples = 1 in the minimal example stops the sampler from working properly.
using AdvancedHMC, Distributions, ForwardDiff
using LinearAlgebra
functiondebug()
# Choose parameter dimensionality and initial parameter value
D =10; initial_θ =rand(D)
# Define the target distributionℓπ(θ) =logpdf(MvNormal(zeros(D), I), θ)
# Set the number of samples to draw and warmup iterations
n_samples, n_adapts =1, 1000# Define a Hamiltonian system
metric =DiagEuclideanMetric(D)
hamiltonian =Hamiltonian(metric, ℓπ, ForwardDiff)
# Define a leapfrog solver, with initial step size chosen heuristically
initial_ϵ =find_good_stepsize(hamiltonian, initial_θ)
integrator =Leapfrog(initial_ϵ)
# Define an HMC sampler, with the following components# - multinomial sampling scheme,# - generalised No-U-Turn criteria, and# - windowed adaption for step-size and diagonal mass matrix
proposal =NUTS{MultinomialTS, GeneralisedNoUTurn}(integrator)
adaptor =StanHMCAdaptor(MassMatrixAdaptor(metric), StepSizeAdaptor(0.8, integrator))
# Run the sampler to draw samples from the specified Gaussian, where# - `samples` will store the samples# - `stats` will store diagnostic statistics for each sample
samples, stats =sample(hamiltonian, proposal, initial_θ, 1, adaptor, n_adapts; progress=true)
end
Not sure if this has been reported. Setting
n_samples = 1
in the minimal example stops the sampler from working properly.Checked on v1.6.2 & v1.6.3, I'm getting
Am I missing something here?
The text was updated successfully, but these errors were encountered: