mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
bug fix: inference_X for add kernel
This commit is contained in:
parent
0834aafdd0
commit
0754275db7
1 changed files with 3 additions and 3 deletions
|
|
@ -151,10 +151,10 @@ class Add(CombinationKernel):
|
||||||
def gradients_qX_expectations(self, dL_dpsi0, dL_dpsi1, dL_dpsi2, Z, variational_posterior):
|
def gradients_qX_expectations(self, dL_dpsi0, dL_dpsi1, dL_dpsi2, Z, variational_posterior):
|
||||||
from static import White, Bias
|
from static import White, Bias
|
||||||
target_grads = [np.zeros(v.shape) for v in variational_posterior.parameters]
|
target_grads = [np.zeros(v.shape) for v in variational_posterior.parameters]
|
||||||
for p1 in self.parameters:
|
for p1 in self.parts:
|
||||||
#compute the effective dL_dpsi1. extra terms appear becaue of the cross terms in psi2!
|
#compute the effective dL_dpsi1. extra terms appear becaue of the cross terms in psi2!
|
||||||
eff_dL_dpsi1 = dL_dpsi1.copy()
|
eff_dL_dpsi1 = dL_dpsi1.copy()
|
||||||
for p2 in self.parameters:
|
for p2 in self.parts:
|
||||||
if p2 is p1:
|
if p2 is p1:
|
||||||
continue
|
continue
|
||||||
if isinstance(p2, White):
|
if isinstance(p2, White):
|
||||||
|
|
@ -169,7 +169,7 @@ class Add(CombinationKernel):
|
||||||
|
|
||||||
def add(self, other):
|
def add(self, other):
|
||||||
if isinstance(other, Add):
|
if isinstance(other, Add):
|
||||||
other_params = other.parameters[:]
|
other_params = other.parts[:]
|
||||||
for p in other_params:
|
for p in other_params:
|
||||||
other.unlink_parameter(p)
|
other.unlink_parameter(p)
|
||||||
self.link_parameters(*other_params)
|
self.link_parameters(*other_params)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue