mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-29 14:56:24 +02:00
parameterized: added warning switch
This commit is contained in:
parent
347e2e7fb0
commit
50db3a90e9
2 changed files with 12 additions and 11 deletions
|
|
@ -225,7 +225,7 @@ class Parameterized(object):
|
||||||
x[matches] = transform.initialize(x[matches])
|
x[matches] = transform.initialize(x[matches])
|
||||||
self._set_params(x)
|
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.
|
:param regexp: which parameters need to be fixed.
|
||||||
|
|
@ -242,6 +242,7 @@ class Parameterized(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
matches = self.grep_param_names(regexp)
|
matches = self.grep_param_names(regexp)
|
||||||
|
if warning:
|
||||||
overlap = set(matches).intersection(set(self.all_constrained_indices()))
|
overlap = set(matches).intersection(set(self.all_constrained_indices()))
|
||||||
if overlap:
|
if overlap:
|
||||||
self.unconstrain(np.asarray(list(overlap)))
|
self.unconstrain(np.asarray(list(overlap)))
|
||||||
|
|
|
||||||
|
|
@ -327,9 +327,9 @@ class MRD(Model):
|
||||||
if titles is None:
|
if titles is None:
|
||||||
titles = [r'${}$'.format(name) for name in self.names]
|
titles = [r'${}$'.format(name) for name in self.names]
|
||||||
ymax = reduce(max, [numpy.ceil(max(g.input_sensitivity())) for g in self.bgplvms])
|
ymax = reduce(max, [numpy.ceil(max(g.input_sensitivity())) for g in self.bgplvms])
|
||||||
def plotf(i, g, ax):
|
def plotf(i, g, axis):
|
||||||
ax.set_ylim([0,ymax])
|
axis.set_ylim([0,ymax])
|
||||||
g.kern.plot_ARD(ax=ax, title=titles[i], *args, **kwargs)
|
g.kern.plot_ARD(ax=axis, title=titles[i], *args, **kwargs)
|
||||||
fig = self._handle_plotting(fignum, ax, plotf, sharex=sharex, sharey=sharey)
|
fig = self._handle_plotting(fignum, ax, plotf, sharex=sharex, sharey=sharey)
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue