mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
add kernel adding another add kernel
This commit is contained in:
parent
ee85229a5d
commit
bf6cdf5d31
2 changed files with 2 additions and 1 deletions
|
|
@ -172,7 +172,7 @@ class Add(CombinationKernel):
|
|||
|
||||
def add(self, other, name='sum'):
|
||||
if isinstance(other, Add):
|
||||
other_params = other._parameters_.copy()
|
||||
other_params = other._parameters_[:]
|
||||
for p in other_params:
|
||||
other.remove_parameter(p)
|
||||
self.add_parameters(*other_params)
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ class KernelGradientTestsContinuous(unittest.TestCase):
|
|||
|
||||
def test_Add(self):
|
||||
k = GPy.kern.Matern32(2, active_dims=[2,3]) + GPy.kern.RBF(2, active_dims=[0,4]) + GPy.kern.Linear(self.D)
|
||||
k += GPy.kern.Matern32(2, active_dims=[2,3]) + GPy.kern.RBF(2, active_dims=[0,4]) + GPy.kern.Linear(self.D)
|
||||
k.randomize()
|
||||
self.assertTrue(check_kernel_gradient_functions(k, X=self.X, X2=self.X2, verbose=verbose))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue