fixed a tie-bug for ND

This commit is contained in:
James Hensman 2013-05-02 10:59:19 +01:00
parent 34edbd1459
commit 350c69799d
2 changed files with 2 additions and 5 deletions

View file

@ -117,6 +117,7 @@ class model(parameterised):
x = self._get_params()
for index,constraint in zip(self.constrained_indices, self.constraints):
g[index] = g[index] * constraint.gradfactor(x[index])
[np.put(g, i, v) for i, v in [(t[0], np.sum(g[t])) for t in self.tied_indices]]
if len(self.tied_indices) or len(self.fixed_indices):
to_remove = np.hstack((self.fixed_indices+[t[1:] for t in self.tied_indices]))
return np.delete(g,to_remove)