mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-11 04:52:37 +02:00
fix the speed problem of the tie framework
This commit is contained in:
parent
525d9329ff
commit
08ed72b2f2
1 changed files with 6 additions and 1 deletions
|
|
@ -70,7 +70,12 @@ class Tie(Remapping):
|
||||||
#more than one of the tied things changed. panic.
|
#more than one of the tied things changed. panic.
|
||||||
raise ValueError, "something is wrong with the tieing"
|
raise ValueError, "something is wrong with the tieing"
|
||||||
def parameters_changed(self):
|
def parameters_changed(self):
|
||||||
super(Tie,self).parameters_changed()
|
#ensure all out parameters have the correct value, as specified by our mapping
|
||||||
|
index = self._highest_parent_.constraints[self]
|
||||||
|
if (self._highest_parent_.param_array[index]==self.value).all():
|
||||||
|
return # STOP TRIGGER THE UPDATE LOOP MULTIPLE TIMES!!!
|
||||||
|
self._highest_parent_.param_array[index] = self.mapping()
|
||||||
|
[p.notify_observers(which=self) for p in self.tied_parameters]
|
||||||
self.collate_gradient()
|
self.collate_gradient()
|
||||||
|
|
||||||
def mapping(self):
|
def mapping(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue