readded mrd plotting changes

This commit is contained in:
Max Zwiessele 2013-04-12 10:07:58 +01:00
parent 51ff92e591
commit 5f76e7cd12
2 changed files with 4 additions and 2 deletions

View file

@ -126,8 +126,8 @@ def mrd_simulation():
s2 = np.vectorize(lambda x: np.cos(x)) s2 = np.vectorize(lambda x: np.cos(x))
sS = np.vectorize(lambda x: np.sin(2 * x)) sS = np.vectorize(lambda x: np.sin(2 * x))
S1 = np.hstack([s1(x), sS(x)]) S1 = np.hstack([s1(x), sS(x)]) + .1 * np.random.randn(N, 2)
S2 = np.hstack([s2(x), sS(x)]) S2 = np.hstack([s2(x), sS(x)]) + .1 * np.random.randn(N, 2)
Y1 = S1.dot(np.random.randn(S1.shape[1], D1)) Y1 = S1.dot(np.random.randn(S1.shape[1], D1))
Y2 = S2.dot(np.random.randn(S2.shape[1], D2)) Y2 = S2.dot(np.random.randn(S2.shape[1], D2))

View file

@ -163,6 +163,7 @@ class MRD(model):
def plot_scales(self, *args, **kwargs): def plot_scales(self, *args, **kwargs):
fig = pylab.figure("MRD Scales", figsize=(4 * len(self.bgplvms), 3)) fig = pylab.figure("MRD Scales", figsize=(4 * len(self.bgplvms), 3))
fig.clf()
for i, g in enumerate(self.bgplvms): for i, g in enumerate(self.bgplvms):
ax = fig.add_subplot(1, len(self.bgplvms), i + 1) ax = fig.add_subplot(1, len(self.bgplvms), i + 1)
g.kern.plot_ARD(ax=ax, *args, **kwargs) g.kern.plot_ARD(ax=ax, *args, **kwargs)
@ -172,6 +173,7 @@ class MRD(model):
def plot_latent(self, *args, **kwargs): def plot_latent(self, *args, **kwargs):
fig = pylab.figure("MRD Latent Spaces", figsize=(4 * len(self.bgplvms), 3)) fig = pylab.figure("MRD Latent Spaces", figsize=(4 * len(self.bgplvms), 3))
fig.clf()
for i, g in enumerate(self.bgplvms): for i, g in enumerate(self.bgplvms):
ax = fig.add_subplot(1, len(self.bgplvms), i + 1) ax = fig.add_subplot(1, len(self.bgplvms), i + 1)
g.plot_latent(ax=ax, *args, **kwargs) g.plot_latent(ax=ax, *args, **kwargs)