TuringLang / AbstractMCMC.jl

Abstract types and interfaces for Markov chain Monte Carlo methods
https://turinglang.org/AbstractMCMC.jl
MIT License
87 stars 18 forks source link

Add `chainsstack` #45

Closed devmotion closed 4 years ago

devmotion commented 4 years ago

This PR tries to address https://github.com/TuringLang/AbstractMCMC.jl/issues/44 by adding a method for (hopefully) concretizing arrays of type Vector{Any} and a chainsstack(x::AbstractVector) that falls back to reduce(chainscat, x) or x, depending on whether eltype(x) <: AbstractChains or not.

devmotion commented 4 years ago

This helps to resolves issues with parallel sampling in EllipticalSliceSampling where each chain is just a vector of samples.

codecov[bot] commented 4 years ago

Codecov Report

Merging #45 into master will increase coverage by 0.07%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
+ Coverage   97.54%   97.61%   +0.07%     
==========================================
  Files           6        6              
  Lines         122      126       +4     
==========================================
+ Hits          119      123       +4     
  Misses          3        3              
Impacted Files Coverage Δ
src/interface.jl 91.66% <100.00%> (+1.66%) :arrow_up:
src/sample.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f03a17d...bb88514. Read the comment docs.