From cbdb89ffe837986efb639469873b64419d68ce81 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Wed, 22 May 2013 12:37:15 +0100 Subject: [PATCH] catching precision infinity exceptions --- GPy/likelihoods/Gaussian.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/likelihoods/Gaussian.py b/GPy/likelihoods/Gaussian.py index e08fee90..98227b16 100644 --- a/GPy/likelihoods/Gaussian.py +++ b/GPy/likelihoods/Gaussian.py @@ -53,7 +53,7 @@ class Gaussian(likelihood): def _set_params(self, x): x = float(x) if self._variance != x: - self.precision = 1. / x + self.precision = 1. / max(x, 1e-6) self.covariance_matrix = np.eye(self.N) * x self.V = (self.precision) * self.Y self._variance = x