From 0f8dbba56d480902c86cfe8bad9e79d9eabae009 Mon Sep 17 00:00:00 2001 From: Neil Lawrence Date: Fri, 7 Mar 2014 17:35:00 +0000 Subject: [PATCH] Modified logexp transformation to prevent it returning zero when argument is under -36. --- GPy/core/transformations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/core/transformations.py b/GPy/core/transformations.py index 59c6a563..73a9837b 100644 --- a/GPy/core/transformations.py +++ b/GPy/core/transformations.py @@ -29,7 +29,7 @@ class transformation(object): class logexp(transformation): domain = POSITIVE def f(self, x): - return np.where(x>lim_val, x, np.log(1. + np.exp(x))) + return np.where(x<-lim_val, np.log(1+np.exp(-lim_val)), np.where(x>lim_val, x, np.log(1. + np.exp(x)))) def finv(self, f): return np.where(f>lim_val, f, np.log(np.exp(f) - 1.)) def gradfactor(self, f):