# New package: ApproximateVI.jl

**URL:** <https://discourse.julialang.org/t/new-package-approximatevi-jl/93454>\
**Category:** Statistics\
**Tags:** package, announcement, bayesian-inference\
**Created:** [January 24, 2023, 11:23am UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454 "2023-01-24T11:23:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikos\_Gianniotis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nikos_gianniotis/32/11487_2.png) [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Post date:** [January 24, 2023, 11:23am UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454/1 "2023-01-24T11:23:43Z")

</div>

Hello everyone,

I recently wrapped up some code of mine and decided for my own sake to package it and register it with general Julia registry.

The package can be found here:

> **[GitHub - ngiann/GaussianVariationalInference.jl: Approximate variational...](https://github.com/ngiann/GaussianVariationalInference.jl)**
>
> Approximate variational inference in Julia. Contribute to ngiann/GaussianVariationalInference.jl development by creating an account on GitHub.

The package is about approximating an intractable (unnormalised) posterior with a Gaussian distribution. The package implements variational inference using the re-parametrisation trick. As far as I know, there is at least one more package that does the same job called [AdvancedVI.jl](https://github.com/TuringLang/AdvancedVI.jl).

What is different in this package is that, as opposed to drawing new samples from the approximate posterior in order to evaluate the intractable expected lower bound (ELBO) at each iteration of the optimiser, the samples are generated once in the first iteration and kept fixed throughout the algorithm.

This has the advantage of working with non-fluctuating gradient which allows the use of optimisers such as LBFGS as opposed to stochastic gradient descent and therefore converges ‘reliably’. The disadvantage is however that the implemented algorithm does not scale well with increasing number of parameters ([AdvancedVI.jl](https://github.com/TuringLang/AdvancedVI.jl) does well in this respect). Therefore, it is recommended to use the package only on problems with a relatively low number of parameters e.g. 2-20.

The work was independently developed and published [here](https://doi.org/10.1007/s10044-015-0496-9), [(Arxiv link)](https://arxiv.org/pdf/1906.04507.pdf). Of course, the method has been widely popularised by the works [Doubly Stochastic Variational Bayes for non-Conjugate Inference](http://proceedings.mlr.press/v32/titsi%20as14.pdf) and [Auto-Encoding Variational Bayes](https://arxiv.org/abs/1312.6114). The method seems to have appeared earlier in [Fixed-Form Variational Posterior Approximation through Stochastic Linear Regression](https://arxiv.org/abs/1206.6679) and again later in [A comparison of variational approximations for fast inference in mixed logit models](https://link.springer.com/article/10.1007%2Fs00180-015-0638-y) and perhaps in other publications too…

Any comments are welcome.

Best, nikos

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [January 24, 2023, 11:37am UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454/2 "2023-01-24T11:37:55Z")

</div>

I don’t think the package name follows the Package Naming Guidelines:

[https://pkgdocs.julialang.org/v1/creating-packages/#Package-naming-guidelines](https://pkgdocs.julialang.org/v1/creating-packages/#Package-naming-guidelines)

In particular:

> 1. Avoid jargon. In particular, avoid acronyms unless there is minimal possibility of confusion.
> 
> - It’s ok to say USA if you’re talking about the USA.
> - It’s not ok to say PMA, even if you’re talking about positive mental attitude.

---

<div class="post-metadata">

**Author:** ![Nikos\_Gianniotis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nikos_gianniotis/32/11487_2.png) [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Post date:** [January 24, 2023, 11:41am UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454/3 "2023-01-24T11:41:21Z")

</div>

That is a good point, I will consider doing this perhaps in the near future. Is there a recommended way of doing this? I suppose creating a new repo and registering it as a new package with the new name would do it. Thanks.

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [January 24, 2023, 12:28pm UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454/4 "2023-01-24T12:28:01Z")

</div>

Julia packages are identified by a UUID, so you should be able to just rename your package, without moving to a whole new repo. I don’t know the exact procedure, but I suppose it’s documented somewhere.

---

<div class="post-metadata">

**Author:** ![Nikos\_Gianniotis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nikos_gianniotis/32/11487_2.png) [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Post date:** [January 24, 2023, 12:45pm UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454/5 "2023-01-24T12:45:39Z")

</div>

Found this: [GitHub - JuliaRegistries/General: The official registry of general Julia packages](https://github.com/JuliaRegistries/General#how-do-i-rename-an-existing-registered-package)  
Thanks.

---

<div class="post-metadata">

**Author:** ![Nikos\_Gianniotis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nikos_gianniotis/32/11487_2.png) [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Post date:** [January 28, 2023, 7:56pm UTC](https://discourse.julialang.org/t/new-package-approximatevi-jl/93454/6 "2023-01-28T19:56:57Z")

</div>

Following @nsajko suggestion for a better name, I have now re-registered the package as GaussianVariationalInference.jl.

> **[GitHub - ngiann/GaussianVariationalInference.jl: Approximate variational...](https://github.com/ngiann/GaussianVariationalInference.jl)**
>
> Approximate variational inference in Julia. Contribute to ngiann/GaussianVariationalInference.jl development by creating an account on GitHub.

Cheers, N
