diff --git a/GPy/core/parameterized.py b/GPy/core/parameterized.py index 5d5184da..35d2795c 100644 --- a/GPy/core/parameterized.py +++ b/GPy/core/parameterized.py @@ -225,7 +225,7 @@ class Parameterized(object): x[matches] = transform.initialize(x[matches]) self._set_params(x) - def constrain_fixed(self, regexp, value=None): + def constrain_fixed(self, regexp, value=None, warning=True): """ :param regexp: which parameters need to be fixed. @@ -242,13 +242,14 @@ class Parameterized(object): """ matches = self.grep_param_names(regexp) - overlap = set(matches).intersection(set(self.all_constrained_indices())) - if overlap: - self.unconstrain(np.asarray(list(overlap))) - print 'Warning: re-constraining these parameters' - pn = self._get_param_names() - for i in overlap: - print pn[i] + if warning: + overlap = set(matches).intersection(set(self.all_constrained_indices())) + if overlap: + self.unconstrain(np.asarray(list(overlap))) + print 'Warning: re-constraining these parameters' + pn = self._get_param_names() + for i in overlap: + print pn[i] self.fixed_indices.append(matches) if value != None: diff --git a/GPy/models_modules/mrd.py b/GPy/models_modules/mrd.py index cc962bd9..7a6bd386 100644 --- a/GPy/models_modules/mrd.py +++ b/GPy/models_modules/mrd.py @@ -327,9 +327,9 @@ class MRD(Model): if titles is None: titles = [r'${}$'.format(name) for name in self.names] ymax = reduce(max, [numpy.ceil(max(g.input_sensitivity())) for g in self.bgplvms]) - def plotf(i, g, ax): - ax.set_ylim([0,ymax]) - g.kern.plot_ARD(ax=ax, title=titles[i], *args, **kwargs) + def plotf(i, g, axis): + axis.set_ylim([0,ymax]) + g.kern.plot_ARD(ax=axis, title=titles[i], *args, **kwargs) fig = self._handle_plotting(fignum, ax, plotf, sharex=sharex, sharey=sharey) return fig