Jacobians should not be computed only for transforms

This commit is contained in:
James Hensman 2015-06-03 21:23:27 +01:00
parent d67e37fcb6
commit c4752c1564

View file

@ -440,13 +440,12 @@ class Indexable(Nameable, Updateable):
log_j = 0. log_j = 0.
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 c is 'fixed':continue if not isinstance(c, Transformation):continue
for jj in j: for jj in j:
if jj in priored_indexes: if jj in priored_indexes:
log_j += c.log_jacobian(x[jj]) log_j += c.log_jacobian(x[jj])
return log_p + log_j return log_p + log_j
def _log_prior_gradients(self): def _log_prior_gradients(self):
"""evaluate the gradients of the priors""" """evaluate the gradients of the priors"""
if self.priors.size == 0: if self.priors.size == 0: