TuringLang / Turing.jl

Bayesian inference with probabilistic programming.
https://turinglang.org
MIT License
2k stars 216 forks source link

Add Base.get method for ModeResult #2269

Closed mhauru closed 1 week ago

mhauru commented 1 week ago

Answers the feature request from #1417

The return type here is a bit questionable. It currently mimics the NamedTuples that MCMCChains returns for Base.get, but I also considered returning NamedArrays like the ModeResult.values field. Opinions on this are welcome.

Fix #1417

mhauru commented 1 week ago

As a fun side effect of this PR, I ran into this case of bizarrely slow type inference: https://github.com/JuliaLang/julia/issues/54879

yebai commented 1 week ago

Thanks @mhauru and @devmotion!