mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-13 05:52:38 +02:00
Merge branch 'devel' of github.com:SheffieldML/GPy into devel
This commit is contained in:
commit
f167940544
7 changed files with 21 additions and 18 deletions
|
|
@ -218,20 +218,19 @@ class Bayesian_GPLVM(sparse_GP, GPLVM):
|
|||
return means, covars
|
||||
|
||||
|
||||
def plot_X_1d(self, fig=None, axes=None, fig_num="LVM mu S 1d", colors=None):
|
||||
def plot_X_1d(self, ax=None, fignum=None, colors=None):
|
||||
"""
|
||||
Plot latent space X in 1D:
|
||||
|
||||
-if fig is given, create Q subplots in fig and plot in these
|
||||
-if axes is given plot Q 1D latent space plots of X into each `axis`
|
||||
-if neither fig nor axes is given create a figure with fig_num and plot in there
|
||||
-if ax is given plot Q 1D latent space plots of X into each `axis`
|
||||
-if neither fig nor ax is given create a figure with fignum and plot in there
|
||||
|
||||
colors:
|
||||
colors of different latent space dimensions Q
|
||||
"""
|
||||
import pylab
|
||||
if fig is None and axes is None:
|
||||
fig = pylab.figure(num=fig_num, figsize=(8, min(12, (2 * self.X.shape[1]))))
|
||||
fig = pylab.figure(num=fignum, figsize=(8, min(12, (2 * self.X.shape[1]))))
|
||||
if colors is None:
|
||||
colors = pylab.gca()._get_lines.color_cycle
|
||||
pylab.clf()
|
||||
|
|
@ -240,10 +239,10 @@ class Bayesian_GPLVM(sparse_GP, GPLVM):
|
|||
plots = []
|
||||
x = np.arange(self.X.shape[0])
|
||||
for i in range(self.X.shape[1]):
|
||||
if axes is None:
|
||||
if ax is None:
|
||||
ax = fig.add_subplot(self.X.shape[1], 1, i + 1)
|
||||
else:
|
||||
ax = axes[i]
|
||||
ax = ax[i]
|
||||
ax.plot(self.X, c='k', alpha=.3)
|
||||
plots.extend(ax.plot(x, self.X.T[i], c=colors.next(), label=r"$\mathbf{{X_{{{}}}}}$".format(i)))
|
||||
ax.fill_between(x,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue