mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-24 20:36:23 +02:00
Revert "[kern] Add kernel was swallowing parts #fix #412"
This reverts commit b8867f1552.
This commit is contained in:
parent
b8867f1552
commit
0abb9b835f
1 changed files with 5 additions and 11 deletions
|
|
@ -13,21 +13,15 @@ class Add(CombinationKernel):
|
||||||
propagates gradients through.
|
propagates gradients through.
|
||||||
|
|
||||||
This kernel will take over the active dims of it's subkernels passed in.
|
This kernel will take over the active dims of it's subkernels passed in.
|
||||||
|
|
||||||
NOTE: The subkernels will be copies of the original kernels, to prevent
|
|
||||||
unexpected behavior.
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, subkerns, name='sum'):
|
def __init__(self, subkerns, name='sum'):
|
||||||
_newkerns = []
|
for i, kern in enumerate(subkerns[:]):
|
||||||
for kern in subkerns:
|
|
||||||
if isinstance(kern, Add):
|
if isinstance(kern, Add):
|
||||||
for part in kern.parts:
|
del subkerns[i]
|
||||||
|
for part in kern.parts[::-1]:
|
||||||
#kern.unlink_parameter(part)
|
#kern.unlink_parameter(part)
|
||||||
_newkerns.append(part.copy())
|
subkerns.insert(i, part.copy())
|
||||||
else:
|
super(Add, self).__init__(subkerns, name)
|
||||||
_newkerns.append(kern.copy())
|
|
||||||
|
|
||||||
super(Add, self).__init__(_newkerns, name)
|
|
||||||
self._exact_psicomp = self._check_exact_psicomp()
|
self._exact_psicomp = self._check_exact_psicomp()
|
||||||
|
|
||||||
def _check_exact_psicomp(self):
|
def _check_exact_psicomp(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue