catching precision infinity exceptions

This commit is contained in:
Max Zwiessele 2013-05-22 12:37:15 +01:00
parent 26dd629181
commit cbdb89ffe8

View file

@ -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