nrontsis / PILCO

Bayesian Reinforcement Learning in Tensorflow
MIT License
314 stars 84 forks source link

Matrix contain inf or nan #27

Closed jastfkjg closed 5 years ago

jastfkjg commented 5 years ago

hello,

when I use mgpr to predict next observation, sometimes “matrix contains infs or nans" error occurs. I find it first appear in mgpr.py predict_given_factorizations, with code c = self.variance / tf.sqrt(tf.linalg.det(B)). It turns out that tf.linalg.det(B) is negative. What should I do about this ?

Thanks

nrontsis commented 5 years ago

Thanks for opening the issue. This shouldn't happen as B is by construction positive definite, thus its determinant must be positive. Perhaps the initial variance s that you are passing is not positive definite?

jastfkjg commented 5 years ago

Thanks. It's a prob in my code. I'll close this.