We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, Going through the documentation I'm wondering how to access the samples from HMC. In the first example the samples are just a vector:
julia> samples, stats = sample(hamiltonian, kernel, initial_θ, n_samples, adaptor, n_adapts; progress=true) julia> samples 100000-element Vector{Vector{Float64}}:
In the AbstractMCMC example the samples are a long vector of some complicated type and I had to dig around to get the actual samples:
julia> samples = AbstractMCMC.sample( model, sampler, n_adapts + n_samples; nadapts = n_adapts, initial_params = initial_θ, ) julia> samples julia> samples 3000-element Vector{AdvancedHMC.Transition{AdvancedHMC.PhasePoint{Vector{Float64}, AdvancedHMC.DualValue{Float64, Vector{Float64}}}, @NamedTuple{n_steps::Int64, is_accept::Bool, acceptance_rate::Float64, log_density::Float64, hamiltonian_energy::Float64, hamiltonian_energy_error::Float64, max_hamiltonian_energy_error::Float64, tree_depth::Int64, numerical_error::Bool, step_size::Float64, nom_step_size::Float64, is_adapt::Bool}}}: [...] julia>reduce(vcat, [s.z.θ for s ∈ samples]) 3000-element Vector{Float64}: -0.21417892820474493 [...]
Am I missing something or is this the correct way of getting to the samples?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
Going through the documentation I'm wondering how to access the samples from HMC. In the
first example the samples are just a vector:
In the AbstractMCMC example the samples are a long vector of some complicated type and I had to dig around to get the actual samples:
Am I missing something or is this the correct way of getting to the samples?
The text was updated successfully, but these errors were encountered: