Black Box VI - Control Variate, Estimation of alpha



I’ve been looking through the source code, but I’m struggling to find the bit, where Black Box Variational Inference is implemented. Specifically, I’m interested in the section, where the score is used as a control variate (as in Ranganath, 2014) and the optimal alpha is estimated. (optimal alpha = Cov(Loss, Score) / Var(Score) )

I would really appreciate if someone could point me to it.

Have a great Sunday and many thanks,


We don’t use it in any algorithms at the moment. It’s work in progress. For example, we have get_control_variate_coef, which calculates control variates in the BBVI style. Contributions advancing and applying it in the algorithms are welcome.


Many thanks for your prompt reply.
Currently busy with another project, but I’ll look into it afterwards!