From ac2d28e2fdf3098704d9346f567a62bd5e75cd51 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 29 May 2014 09:55:49 +0100 Subject: [PATCH] reverting the fixing behaviour. two reasons: 1) the new behaviour is confusing for new users. Either something is fixed, or it's not. 2) the fixing didn't work! things that should have been fixed were passed to the optimizer for optimization. If we really want to save keystrokes, consider this: m.foo.fix() m.foo.unfix() m.foo.constrain_positive() is the same as m.foo.fix() m.foo.constrain_positive() but the latter throws a warning. --- GPy/core/parameterization/parameter_core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GPy/core/parameterization/parameter_core.py b/GPy/core/parameterization/parameter_core.py index 9cedc46d..dab5c2d0 100644 --- a/GPy/core/parameterization/parameter_core.py +++ b/GPy/core/parameterization/parameter_core.py @@ -324,7 +324,6 @@ class Indexable(Nameable, Observable): self._default_constraint_ = default_constraint from index_operations import ParameterIndexOperations self.constraints = ParameterIndexOperations() - self._old_constraints = ParameterIndexOperations() self.priors = ParameterIndexOperations() if self._default_constraint_ is not None: self.constrain(self._default_constraint_) @@ -388,8 +387,8 @@ class Indexable(Nameable, Observable): if value is not None: self[:] = value - index = self._raveled_index() - # reconstrained = self.unconstrain() + #index = self._raveled_index() + index = self.unconstrain() index = self._add_to_index_operations(self.constraints, index, __fixed__, warning) self._highest_parent_._set_fixed(self, index) self.notify_observers(self, None if trigger_parent else -np.inf)