API
AdvancedVI.vi — Functionvi(model, alg::VariationalInference)
vi(model, alg::VariationalInference, q::VariationalPosterior)
vi(model, alg::VariationalInference, getq::Function, θ::AbstractArray)Constructs the variational posterior from the model and performs the optimization following the configuration of the given VariationalInference instance.
Arguments
model:Turing.ModelorFunctionz ↦ log p(x, z) wherexdenotes the observationsalg: the VI algorithm usedq: aVariationalPosteriorfor which it is assumed a specialized implementation of the variational objective used exists.getq: function taking parametersθas input and returns aVariationalPosteriorθ: only required ifgetqis used, in which case it is the initial parameters for the variational posterior
AdvancedVI.ADVI — Typestruct ADVI{AD} <: VariationalInference{AD}Automatic Differentiation Variational Inference (ADVI) with automatic differentiation backend AD.
Fields
samples_per_step::Int64: Number of samples used to estimate the ELBO in each optimization step.max_iters::Int64: Maximum number of gradient steps.adtype::Any: AD backend used for automatic differentiation.