diff --git a/GPy/examples/dimensionality_reduction.py b/GPy/examples/dimensionality_reduction.py index 93ce374d..0683ecdb 100644 --- a/GPy/examples/dimensionality_reduction.py +++ b/GPy/examples/dimensionality_reduction.py @@ -126,8 +126,8 @@ def mrd_simulation(): s2 = np.vectorize(lambda x: np.cos(x)) sS = np.vectorize(lambda x: np.sin(2 * x)) - S1 = np.hstack([s1(x), sS(x)]) - S2 = np.hstack([s2(x), sS(x)]) + S1 = np.hstack([s1(x), sS(x)]) + .1 * np.random.randn(N, 2) + S2 = np.hstack([s2(x), sS(x)]) + .1 * np.random.randn(N, 2) Y1 = S1.dot(np.random.randn(S1.shape[1], D1)) Y2 = S2.dot(np.random.randn(S2.shape[1], D2)) diff --git a/GPy/models/mrd.py b/GPy/models/mrd.py index bd1c3528..ca03f7c4 100644 --- a/GPy/models/mrd.py +++ b/GPy/models/mrd.py @@ -163,6 +163,7 @@ class MRD(model): def plot_scales(self, *args, **kwargs): fig = pylab.figure("MRD Scales", figsize=(4 * len(self.bgplvms), 3)) + fig.clf() for i, g in enumerate(self.bgplvms): ax = fig.add_subplot(1, len(self.bgplvms), i + 1) g.kern.plot_ARD(ax=ax, *args, **kwargs) @@ -172,6 +173,7 @@ class MRD(model): def plot_latent(self, *args, **kwargs): fig = pylab.figure("MRD Latent Spaces", figsize=(4 * len(self.bgplvms), 3)) + fig.clf() for i, g in enumerate(self.bgplvms): ax = fig.add_subplot(1, len(self.bgplvms), i + 1) g.plot_latent(ax=ax, *args, **kwargs)