TuringLang / AdvancedHMC.jl

Robust, modular and efficient implementation of advanced Hamiltonian Monte Carlo algorithms
https://turinglang.org/AdvancedHMC.jl/
MIT License
245 stars 41 forks source link

Problem with show method for DenseEuclideanMetric #105

Closed andreasnoack closed 5 years ago

andreasnoack commented 5 years ago
julia> AdvancedHMC.DenseEuclideanMetric(Matrix{Float64}(I, 3, 3))
DiagEuclideanMetric([1.0, 1.0, 1.0])
yebai commented 5 years ago

Thanks for spotting this. This issue should be fixed by https://github.com/TuringLang/AdvancedHMC.jl/pull/106.

yebai commented 5 years ago

@xukai92 does the show method for metric always print the diagonal only? If so, maybe warn the user that "only diagonal elements are showed" to avoid potential confusion.

xukai92 commented 5 years ago

Yes it only print the diagonal. How do you think to warn the user?

I guess we could do something like DenseEuclideanMetric(diag=[1.0, 1.0, 1.0])?

yebai commented 5 years ago

I guess we could do something like DenseEuclideanMetric(diag=[1.0, 1.0, 1.0])?

That looks good to me!

xukai92 commented 5 years ago

Closed by #106 and #107