locked
Problems implementing a Bayes network: ImproperMessageException or "result is nan" RRS feed

  • Question

  • Hi,
    I'm trying to implement  http://research.microsoft.com/apps/pubs/?id=119092 using publicly available Yandex click data (http://imat-relpred.yandex.ru/en).

    Unfortunately I'm getting "result is nan" exception and some Gaussians having infinite means (in the degenerate case of Constants.ModelRanks = 1, i.e. only one level in the Bayes network) or ImproperMessageException (in case of 2 and more levels). I'm using online learning (as well as the paper), and hitting the exception after thousands of iterations. Priors are set to be Gaussians.

    Do you have any clues on how I could solve the problem?

    My code can be viewed here:

    Model class: http://paste.pocoo.org/show/533288/

    ModelParameters class: http://paste.pocoo.org/show/533289/

     

    If needed, I can send you a full project copy with data.

     

    Thanks,

    Vadim 


    From Russia with Love
    Wednesday, January 11, 2012 11:49 AM

Answers

  • I think the problem is that you forgot to add an error term in the definitions of A[i], B[i], and R[i] as done in the paper equation (13).  A simple fix is to change expressions like (R[i] > 0) into (Variable.GaussianFromMeanAndVariance(R[i],1) > 0).
    • Marked as answer by Vadim Kantorov Wednesday, January 11, 2012 5:32 PM
    Wednesday, January 11, 2012 3:15 PM
    Owner

All replies

  • I think the problem is that you forgot to add an error term in the definitions of A[i], B[i], and R[i] as done in the paper equation (13).  A simple fix is to change expressions like (R[i] > 0) into (Variable.GaussianFromMeanAndVariance(R[i],1) > 0).
    • Marked as answer by Vadim Kantorov Wednesday, January 11, 2012 5:32 PM
    Wednesday, January 11, 2012 3:15 PM
    Owner
  • Thanks a very fast response! Seems to work now!
    From Russia with Love
    Wednesday, January 11, 2012 5:33 PM