MeanFieldApprox¶
An approximation of the posterior that assumes that all variables are independent of each other and can each be approximated by a univariate Gaussian.
The analytic variant is very fast to compute due to its use of closed-form expressions for the KL divergence, and is the historically most common form of variational inference, before the advent of stochastic variational inference. The basic variant is mathematically equivalent but does not use the closed-form expressions, and is therefore simpler and potentially more robust to numerical issues or model misspecification. However, both approximations have in common that they can be seriously biased if the posterior has strong correlations between variables, followes a skewed or otherwise non-Gaussian distribution, or has multiple modes. For this reason this method should only be used if the posterior has been verified to be well explained by these assumptions (using a sample-based method such as MCMC); otherwise the user should consider upgrading to a better approximation such as the Multivariate Normal or BNAF approximations. More Info... Version 1.0.0
Ports/Properties¶
initial_scale¶
The initial standard deviation for the variational distribution.
- verbose name: Initial Scale
- default value: 0.1
- port type: FloatPort
- value type: float (can be None)
variant¶
The variant to use. The analytic variant is the classic textbook mean-field variational inference, which uses closed-form expressions for the KL divergence; This variant is therefore more efficient and has somewhat better site names than the 'basic' variant. The basic variant is the simplest variational approximation and does not make many distributional assumptions, and is therefore a good starting point for testing or debugging of inference issues.
- verbose name: Variant
- default value: analytic
- port type: EnumPort
- value type: str (can be None)
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)