mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 20:12:38 +02:00
new constrain_negative negative_logexp (selected by default)
This commit is contained in:
parent
05e8e75c58
commit
97acb36b55
2 changed files with 15 additions and 1 deletions
|
|
@ -36,6 +36,20 @@ class logexp(transformation):
|
|||
def __str__(self):
|
||||
return '(+ve)'
|
||||
|
||||
class negative_logexp(transformation):
|
||||
domain = NEGATIVE
|
||||
def f(self, x):
|
||||
return -np.log(1. + np.exp(x))
|
||||
def finv(self, f):
|
||||
return np.log(np.exp(-f) - 1.)
|
||||
def gradfactor(self, f):
|
||||
ef = np.exp(-f)
|
||||
return -(ef - 1.) / ef
|
||||
def initialize(self, f):
|
||||
return -np.abs(f)
|
||||
def __str__(self):
|
||||
return '(-ve)'
|
||||
|
||||
class logexp_clipped(transformation):
|
||||
max_bound = 1e100
|
||||
min_bound = 1e-10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue