mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
[#133] fix: chainging constraint in __init__
This commit is contained in:
parent
bccd8e094a
commit
ac4dbb851d
3 changed files with 28 additions and 3 deletions
|
|
@ -636,10 +636,18 @@ class Indexable(Nameable, Observable):
|
|||
"""
|
||||
From Parentable:
|
||||
Called when the parent changed
|
||||
|
||||
update the constraints and priors view, so that
|
||||
constraining is automized for the parent.
|
||||
"""
|
||||
from index_operations import ParameterIndexOperationsView
|
||||
self.constraints = ParameterIndexOperationsView(parent.constraints, parent._offset_for(self), self.size)
|
||||
self.priors = ParameterIndexOperationsView(parent.priors, parent._offset_for(self), self.size)
|
||||
#if getattr(self, "_in_init_"):
|
||||
#import ipdb;ipdb.set_trace()
|
||||
#self.constraints.update(param.constraints, start)
|
||||
#self.priors.update(param.priors, start)
|
||||
offset = parent._offset_for(self)
|
||||
self.constraints = ParameterIndexOperationsView(parent.constraints, offset, self.size)
|
||||
self.priors = ParameterIndexOperationsView(parent.priors, offset, self.size)
|
||||
self._fixes_ = None
|
||||
for p in self.parameters:
|
||||
p._parent_changed(parent)
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ class Parameterized(Parameterizable):
|
|||
self.priors.update(param.priors, start)
|
||||
self.parameters.insert(index, param)
|
||||
|
||||
self._notify_parent_change()
|
||||
param.add_observer(self, self._pass_through_notify_observers, -np.inf)
|
||||
|
||||
parent = self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue