mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
add untie
This commit is contained in:
parent
11bb1e4c4c
commit
cf638a9e34
3 changed files with 9 additions and 6 deletions
|
|
@ -554,6 +554,11 @@ class Indexable(Nameable, Observable):
|
||||||
plist = list(plist)
|
plist = list(plist)
|
||||||
plist.append(self)
|
plist.append(self)
|
||||||
self._highest_parent_.ties.tie_together(plist)
|
self._highest_parent_.ties.tie_together(plist)
|
||||||
|
|
||||||
|
def untie(self, *plist):
|
||||||
|
plist = list(plist)
|
||||||
|
plist.append(self)
|
||||||
|
self._highest_parent_.ties.untie(plist)
|
||||||
|
|
||||||
#===========================================================================
|
#===========================================================================
|
||||||
# Constrain operations -> done
|
# Constrain operations -> done
|
||||||
|
|
|
||||||
|
|
@ -161,12 +161,11 @@ class Parameterized(Parameterizable):
|
||||||
parent.size += param.size
|
parent.size += param.size
|
||||||
parent = parent._parent_
|
parent = parent._parent_
|
||||||
|
|
||||||
|
self._notify_parent_change()
|
||||||
|
self._highest_parent_._notify_parent_change()
|
||||||
if not self._in_init_:
|
if not self._in_init_:
|
||||||
self._connect_parameters()
|
self._connect_parameters()
|
||||||
self._notify_parent_change()
|
|
||||||
|
|
||||||
self._highest_parent_._connect_parameters(ignore_added_names=_ignore_added_names)
|
self._highest_parent_._connect_parameters(ignore_added_names=_ignore_added_names)
|
||||||
self._highest_parent_._notify_parent_change()
|
|
||||||
self._highest_parent_._connect_fixes()
|
self._highest_parent_._connect_fixes()
|
||||||
|
|
||||||
if isinstance(param,Parameterized):
|
if isinstance(param,Parameterized):
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class Tie(Parameterized):
|
||||||
1. Add the support for multiple parameter tie_together and tie_vector
|
1. Add the support for multiple parameter tie_together and tie_vector
|
||||||
2. Properly handling parameters with constraints
|
2. Properly handling parameters with constraints
|
||||||
3. Properly handling the merging of two models [DONE]
|
3. Properly handling the merging of two models [DONE]
|
||||||
4. Properly handling initialization
|
4. Properly handling initialization [DONE]
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, name='Ties'):
|
def __init__(self, name='Ties'):
|
||||||
|
|
@ -102,7 +102,7 @@ class Tie(Parameterized):
|
||||||
self._remove_unnecessary_ties()
|
self._remove_unnecessary_ties()
|
||||||
self._update_label_buf()
|
self._update_label_buf()
|
||||||
self.updates = True
|
self.updates = True
|
||||||
|
|
||||||
def _sync_val_group(self, plist):
|
def _sync_val_group(self, plist):
|
||||||
val = np.asarray([p.param_array for p in plist]).mean()
|
val = np.asarray([p.param_array for p in plist]).mean()
|
||||||
def _set_val(p):
|
def _set_val(p):
|
||||||
|
|
@ -238,7 +238,6 @@ class Tie(Parameterized):
|
||||||
self._update_label_buf()
|
self._update_label_buf()
|
||||||
self.updates = True
|
self.updates = True
|
||||||
|
|
||||||
|
|
||||||
def _check_change(self):
|
def _check_change(self):
|
||||||
changed = False
|
changed = False
|
||||||
if self.tied_param is not None:
|
if self.tied_param is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue