Jacobians should not be computed only for transforms

This commit is contained in:
James Hensman 2015-06-03 21:27:17 +01:00
parent c4752c1564
commit 451f145f88

View file

@ -457,6 +457,7 @@ class Indexable(Nameable, Updateable):
#add in jacobian derivatives if transformed #add in jacobian derivatives if transformed
priored_indexes = np.hstack([i for p, i in self.priors.items()]) priored_indexes = np.hstack([i for p, i in self.priors.items()])
for c,j in self.constraints.items(): for c,j in self.constraints.items():
if not isinstance(c, Transformation):continue
for jj in j: for jj in j:
if jj in priored_indexes: if jj in priored_indexes:
ret[jj] += c.log_jacobian_grad(x[jj]) ret[jj] += c.log_jacobian_grad(x[jj])