REVERT a53690ab7f, flapack back substitued in

This commit is contained in:
Max Zwiessele 2013-05-31 12:09:11 +01:00
parent 43c2f8af87
commit 4eebf99bfb
15 changed files with 96 additions and 101 deletions

View file

@ -199,13 +199,13 @@ class kern(parameterised):
[p._set_params(x[s]) for p, s in zip(self.parts, self.param_slices)]
def _get_param_names(self):
# this is a bit nasty: we wat to distinguish between parts with the same cd48_name by appending a count
# this is a bit nasty: we wat to distinguish between parts with the same name by appending a count
part_names = np.array([k.name for k in self.parts], dtype=np.str)
counts = [np.sum(part_names == ni) for i, ni in enumerate(part_names)]
cum_counts = [np.sum(part_names[i:] == ni) for i, ni in enumerate(part_names)]
names = [cd48_name + '_' + str(cum_count) if count > 1 else cd48_name for cd48_name, count, cum_count in zip(part_names, counts, cum_counts)]
names = [name + '_' + str(cum_count) if count > 1 else name for name, count, cum_count in zip(part_names, counts, cum_counts)]
return sum([[cd48_name + '_' + n for n in k._get_param_names()] for cd48_name, k in zip(names, self.parts)], [])
return sum([[name + '_' + n for n in k._get_param_names()] for name, k in zip(names, self.parts)], [])
def K(self, X, X2=None, which_parts='all'):
if which_parts == 'all':

View file

@ -98,11 +98,7 @@ class linear(kernpart):
target += tmp.sum()
def dK_dX(self, dL_dK, X, X2, target):
# dim = np.where(np.array(X2.shape)[:, None] == dL_dK.shape)[0].flat[0]
# X2_ = np.expand_dims(X2, dim)
# target += ((X2_ * self.variances) * dL_dK[:, :, None]).sum(int(not dim))
target += (((X2[None, :, :] * self.variances)) * dL_dK[:, :, None]).sum(1)
# target += (((X2[None, :, :] * self.variances)) * dL_dK[:, :, None]).sum(0)
target += (((X2[:, None, :] * self.variances)) * dL_dK[:, :, None]).sum(0)
#---------------------------------------#
# PSI statistics #
@ -138,7 +134,7 @@ class linear(kernpart):
target_mu += (dL_dpsi1.T[:, :, None] * (Z * self.variances)).sum(1)
def dpsi1_dZ(self, dL_dpsi1, Z, mu, S, target):
self.dK_dX(dL_dpsi1, Z, mu, target)
self.dK_dX(dL_dpsi1.T, Z, mu, target)
def psi2(self, Z, mu, S, target):
"""