Following Black-Box Stochastic Variational Inference in Five Lines of Python[1]
See code at: https://github.com/HIPS/autograd/blob/master/examples/black_box_svi.py
The first animation from that paper:
[1] Duvenaud, David, and Ryan P. Adams. "Black-box stochastic variational inference in five lines of Python." NIPS Workshop on Black-box Learning and Inference. 2015.