mattjj / svae

code for Structured Variational Autoencoders
349 stars 88 forks source link

NIW natural parameterization #9

Closed jcapde closed 7 years ago

jcapde commented 7 years ago

Hi! Thanks for sharing the code and congrats for this amazing article!

I have a particular doubt about the natural parameterisation of the NIW distribution and I saw that in your code there is a function to re-parameterise it (standard_to_natural() in svae/distributions/niw.py). In particular, I don't exactly see where the outer product in parameter S. Do you know any reference where I can check out the natural parameterisation for the NIW distribution (I couldn't find any)?

Many thanks in advance!

jcapde commented 7 years ago

I think I've found it. I was missing the fact that matrix parameters are vectorised in the Inv-Wishart exponential form and the trace of becomes their vector dot product (kappamTm). Then, the outer product makes totally sense, since the resulting matrix will also be vectorised and the the dot product with X will give us the missing term kappamTX-1m. Thanks again!

mattjj commented 7 years ago

Thanks for your question, and for answering it too! It would be good to document these things better. My pybasicbayes repo follows more standard conventions.