bayesmix-dev / bayesmix

Flexible Bayesian nonparametric mixture models in C++
https://bayesmix.rtfd.io
BSD 3-Clause "New" or "Revised" License
22 stars 18 forks source link

State template #125

Closed mberaha closed 2 years ago

mberaha commented 2 years ago

By templating the Prior over the State, we can avoid having to serialize and de-serialize to and from proto every time we sample with a SemiConjugateUpdater.

In a benchmark one-dimensional example with 2 clusters, this gives a 30% performance improvement. It is likely that the improvement will eventually be irrelevant in more challenging scenarios with multivariate data.

At the moment, only the NNIGHierarchy has been changed.

mberaha commented 2 years ago

All the classes have been ported