locked
Implementing a Logistic Normal Distribution RRS feed

  • Question

  • Hi all,

    I'm trying to implement David Blei's Correlated Topic Model (http://www.cs.princeton.edu/~blei/papers/BleiLafferty2007.pdf), which is basically LDA but with the per-document topic distribution drawn from a Logistic Normal Distribution rather than a Dirichlet. More specifically, the variable is drawn from a multivariate Gaussian, put through an exponential function and then normalised so that the values sum to one.

    Is there an easy way to define such a variable/distribution in Infer.NET? I went as far as defining my own Factor class but then am unsure as to how I should go about implementing its corresponding Operator class :(

    Any help is greatly appreciated. 

    Thanks and regards,
    Josiah 

    Wednesday, September 14, 2011 1:20 AM

Answers

  • The Softmax factor already does what you want.  However, version 2.4 Beta 2 does not provide Softmax of a vector, only Softmax of a double array.  You can use ArrayFromVector to convert from a Gaussian vector, but this loses the correlations (it converts from VectorGaussian to array of Gaussian).  The next beta release will have Softmax of a vector.
    Wednesday, September 14, 2011 12:28 PM
    Owner

All replies

  • The Softmax factor already does what you want.  However, version 2.4 Beta 2 does not provide Softmax of a vector, only Softmax of a double array.  You can use ArrayFromVector to convert from a Gaussian vector, but this loses the correlations (it converts from VectorGaussian to array of Gaussian).  The next beta release will have Softmax of a vector.
    Wednesday, September 14, 2011 12:28 PM
    Owner
  • Ah... didn't realise that it's there. Perfect! Thanks Tom!

    Regards,
    Josiah

    Wednesday, September 14, 2011 9:50 PM