google / edward2

A simple probabilistic programming language.
Apache License 2.0
679 stars 74 forks source link

Gaussian Process confronts "Cholesky decomposition was not successful. The input might not be valid." #400

Open yezhengli-Mr9 opened 4 years ago

yezhengli-Mr9 commented 4 years ago

Although Gaussian kernel (RBF Kernel) is positive definite, I think Gaussian Process from time to time confronts Cholesky decomposition was not successful. The input might not be valid. after (1) covariance_matrix = self.covariance_fn(inputs, inputs) with self.covariance_fn=ExponentiatedQuadratic; (2) covariance_matrix = tf.linalg.set_diag(covariance_matrix,tf.linalg.diag_part(covariance_matrix) + tf.keras.backend.epsilon())

Meanwhile, covariance_matrix = tf.linalg.set_diag(covariance_matrix,tf.linalg.diag_part(covariance_matrix) + 100* tf.keras.backend.epsilon()) might help but cannot solve the problem in a scientific way,only reduce the frequency of the error:

Cholesky decomposition was not successful. The input might not be valid.

yezhengli-Mr9 commented 4 years ago

OK, I see that "Cholesky decompositions are a common failure mode in GP optimizations" in github.com/tensorflow/probability/issues/650.

yezhengli-Mr9 commented 4 years ago

I also tried to adjust covariance_fn=ExponentiatedQuadratic(variance=1., lengthscale=1.) but does not quite help.