Remove the dependency on matplotlib

This commit is contained in:
Zhenwen Dai 2014-09-12 11:51:51 +01:00
parent d7eee6aa00
commit 049b58c729
22 changed files with 80 additions and 48 deletions

View file

@ -3,8 +3,6 @@
import numpy as np
import pylab as pb
import sys, pdb
from ..core import GP
from ..models import GPLVM
from ..mappings import *

View file

@ -3,7 +3,6 @@
import numpy as np
import pylab as pb
from .. import kern
from ..core import GP, Param
from ..likelihoods import Gaussian
@ -55,7 +54,7 @@ class GPLVM(GP):
#J = np.zeros((X.shape[0],X.shape[1],self.output_dim))
J = self.jacobian(X)
for i in range(X.shape[0]):
target[i]=np.sqrt(pb.det(np.dot(J[i,:,:],np.transpose(J[i,:,:]))))
target[i]=np.sqrt(np.linalg.det(np.dot(J[i,:,:],np.transpose(J[i,:,:]))))
return target
def plot(self):
@ -63,6 +62,7 @@ class GPLVM(GP):
pb.scatter(self.likelihood.Y[:, 0], self.likelihood.Y[:, 1], 40, self.X[:, 0].copy(), linewidth=0, cmap=pb.cm.jet) # @UndefinedVariable
Xnew = np.linspace(self.X.min(), self.X.max(), 200)[:, None]
mu, _ = self.predict(Xnew)
import pylab as pb
pb.plot(mu[:, 0], mu[:, 1], 'k', linewidth=1.5)
def plot_latent(self, labels=None, which_indices=None,

View file

@ -3,13 +3,8 @@
import numpy as np
import pylab as pb
import sys, pdb
import sys
from GPy.models.sparse_gp_regression import SparseGPRegression
from GPy.models.gplvm import GPLVM
# from .. import kern
# from ..core import model
# from ..util.linalg import pdinv, PCA
class SparseGPLVM(SparseGPRegression):
"""