KLMinRepGradDescent
This is a convenience constructor for ParamSpaceSGD
with the RepGradELBO
objective. This is equivalent to the algorithm commonly referred as automatic differentiation variational inference[KTRGB2017]. KLMinRepGradDescent
is also an alias of ADVI
.
AdvancedVI.KLMinRepGradDescent
— FunctionKLMinRepGradDescent(adtype; entropy, optimizer, n_samples, averager, operator)
KL divergence minimization by running stochastic gradient descent with the reparameterization gradient in the Euclidean space of variational parameters.
Arguments
adtype::ADTypes.AbstractADType
: Automatic differentiation backend.
Keyword Arguments
entropy
: Entropy gradient estimator to be used. Must be one ofClosedFormEntropy
,StickingTheLandingEntropy
,MonteCarloEntropy
. (default:ClosedFormEntropy()
)optimizer::Optimisers.AbstractRule
: Optimization algorithm to be used. (default:DoWG()
)n_samples::Int
: Number of Monte Carlo samples to be used for estimating each gradient. (default:1
)averager::AbstractAverager
: Parameter averaging strategy.operator::Union{<:IdentityOperator, <:ClipScale}
: Operator to be applied after each gradient descent step. (default:ClipScale()
)
Requirements
- The trainable parameters in the variational approximation are expected to be extractable through
Optimisers.destructure
. This requires the variational approximation to be marked as a functor throughFunctors.@functor
. - The variational approximation $q_{\lambda}$ implements
rand
. - The target distribution and the variational approximation have the same support.
- The target
LogDensityProblems.logdensity(prob, x)
must be differentiable with respect tox
by the selected AD backend. - Additonal requirements on
q
may apply depending on the choice ofentropy
.
- KTRGB2017Kucukelbir, A., Tran, D., Ranganath, R., Gelman, A., & Blei, D. M. (2017). Automatic differentiation variational inference. Journal of Machine Learning Research, 18(14), 1-45.