mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
Merge branch 'devel' of github.com:SheffieldML/GPy into devel
This commit is contained in:
commit
3b35d6d321
3 changed files with 16 additions and 2 deletions
|
|
@ -187,7 +187,7 @@ class Parameterized(object):
|
|||
|
||||
def constrain_negative(self, regexp):
|
||||
""" Set negative constraints. """
|
||||
self.constrain(regexp, transformations.negative_exponent())
|
||||
self.constrain(regexp, transformations.negative_logexp())
|
||||
|
||||
def constrain_positive(self, regexp):
|
||||
""" Set positive constraints. """
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ def periodic_Matern52(input_dim, variance=1., lengthscale=None, period=2 * np.pi
|
|||
:param n_freq: the number of frequencies considered for the periodic subspace
|
||||
:type n_freq: int
|
||||
"""
|
||||
part = parts.periodic_Matern52part(input_dim, variance, lengthscale, period, n_freq, lower, upper)
|
||||
part = parts.periodic_Matern52.PeriodicMatern52(input_dim, variance, lengthscale, period, n_freq, lower, upper)
|
||||
return kern(input_dim, [part])
|
||||
|
||||
def prod(k1,k2,tensor=False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue