variouschanges

This commit is contained in:
James Hensman 2014-02-13 13:53:49 +00:00
parent 83d3389644
commit 80a734e153
4 changed files with 20 additions and 10 deletions

View file

@ -33,7 +33,8 @@ 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, x, np.log(1. + np.exp(np.clip(x, -np.inf, _lim_val))))
#raises overflow warning: return 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):