mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-11 21:12:38 +02:00
plotting behaviour adapted for BGPLVM
This commit is contained in:
parent
2b0858b697
commit
8bdb14b0f9
1 changed files with 11 additions and 11 deletions
|
|
@ -256,19 +256,19 @@ class MRD(model):
|
||||||
self.Z = Z
|
self.Z = Z
|
||||||
return Z
|
return Z
|
||||||
|
|
||||||
def _handle_plotting(self, fignum, ax, plotf):
|
def _handle_plotting(self, fignum, axes, plotf):
|
||||||
if ax is None:
|
if axes is None:
|
||||||
fig = pylab.figure(num=fignum, figsize=(4 * len(self.bgplvms), 3))
|
fig = pylab.figure(num=fignum, figsize=(4 * len(self.bgplvms), 3))
|
||||||
for i, g in enumerate(self.bgplvms):
|
for i, g in enumerate(self.bgplvms):
|
||||||
if ax is None:
|
if axes is None:
|
||||||
ax = fig.add_subplot(1, len(self.bgplvms), i + 1)
|
axes = fig.add_subplot(1, len(self.bgplvms), i + 1)
|
||||||
elif isinstance(ax, (tuple, list)):
|
elif isinstance(axes, (tuple, list)):
|
||||||
ax = ax[i]
|
axes = axes[i]
|
||||||
else:
|
else:
|
||||||
raise ValueError("Need one ax per latent dimension Q")
|
raise ValueError("Need one axes per latent dimension Q")
|
||||||
plotf(i, g, ax)
|
plotf(i, g, axes)
|
||||||
pylab.draw()
|
pylab.draw()
|
||||||
if ax is None:
|
if axes is None:
|
||||||
fig.tight_layout()
|
fig.tight_layout()
|
||||||
return fig
|
return fig
|
||||||
else:
|
else:
|
||||||
|
|
@ -286,11 +286,11 @@ class MRD(model):
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
def plot_scales(self, fignum="MRD Scales", ax=None, *args, **kwargs):
|
def plot_scales(self, fignum="MRD Scales", ax=None, *args, **kwargs):
|
||||||
fig = self._handle_plotting(fignum, ax, lambda i, g, ax: g.kern.plot_ARD(ax=ax, *args, **kwargs))
|
fig = self._handle_plotting(fignum, ax, lambda i, g, ax: g.kern.plot_ARD(axes=ax, *args, **kwargs))
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
def plot_latent(self, fignum="MRD Latent Spaces", ax=None, *args, **kwargs):
|
def plot_latent(self, fignum="MRD Latent Spaces", ax=None, *args, **kwargs):
|
||||||
fig = self._handle_plotting(fignum, ax, lambda i, g, ax: g.plot_latent(ax=ax, *args, **kwargs))
|
fig = self._handle_plotting(fignum, ax, lambda i, g, ax: g.plot_latent(axes=ax, *args, **kwargs))
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
def _debug_plot(self):
|
def _debug_plot(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue