Sample() nchains vs n_chains

sample() has many methods. One has nchains and another has n_chains. What is the difference between these parameters?

nchains: sample(model::AbstractMCMC.AbstractModel, sampler::AbstractMCMC.AbstractSampler, parallel::AbstractMCMC.AbstractMCMCParallel, N::Integer, nchains::Integer; kwargs...) in AbstractMCMC
n_chains:  sample(rng::AbstractRNG, model::AbstractMCMC.AbstractModel, sampler::DynamicPPL.Sampler{var"#s60",S} where S<:DynamicPPL.AbstractSamplerState where var"#s60"<:Turing.Inference.InferenceAlgorithm, parallel::AbstractMCMC.AbstractMCMCParallel, N::Integer, n_chains::Integer; chain_type, progress, kwargs...) in Turing.Inference

cc: @cpfiffer

The first one is the method that you end up calling – the second is an internal one that eventually gets called by the first. Practically, it doesn’t matter much that it’s n_chains vs. nchains, since the first method call is positional and not a keyword argument.

That said, these should probably be unified just to avoid confusion.

1 Like