BBVI Stochastic Optimizer
When To Use
Use this skill to update variational parameters with BBVI gradient estimates. It supports fixed Robbins-Monro-style scalar ascent and diagonal AdaGrad updates from the paper.
Do not use it to compute BBVI gradients or to evaluate predictive likelihood.
Inputs
params: current variational parameters as a numeric list.gradient: gradient estimate with the same shape.method:scalaroradagrad.learning_rate: scalar base learning rate.state: optional AdaGrad accumulator.
Outputs
params_beforeandparams_after.gradientandstep.state_beforeandstate_after.optimizer_step_executedboolean.
Workflow
- Validate finite parameters and gradients.
- For
scalar, applyparams + learning_rate * gradient. - For
adagrad, update the squared-gradient accumulator and applylearning_rate / sqrt(accumulator + epsilon)per parameter. - Return a trace suitable for recovery validation.
Validation
Run:
python tests/test_optimizer.py
Limitations
This skill performs ascent. If minimizing a loss, negate the gradient before calling it.