mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-01 15:52:39 +02:00
debugging BGPLVM
This commit is contained in:
parent
151c426a3a
commit
bf2d641112
3 changed files with 21 additions and 19 deletions
|
|
@ -6,23 +6,21 @@ import pylab as pb
|
|||
import GPy
|
||||
np.random.seed(123344)
|
||||
|
||||
N = 10
|
||||
M = 3
|
||||
Q = 4
|
||||
D = 5
|
||||
N = 3
|
||||
M = 2
|
||||
Q = 2
|
||||
D = 4
|
||||
#generate GPLVM-like data
|
||||
X = np.random.rand(N, Q)
|
||||
k = GPy.kern.rbf(Q) + GPy.kern.white(Q, 0.00001)
|
||||
K = k.K(X)
|
||||
Y = np.random.multivariate_normal(np.zeros(N),K,D).T
|
||||
|
||||
<<<<<<< HEAD
|
||||
k = GPy.kern.rbf(Q) + GPy.kern.rbf(Q) + GPy.kern.white(Q)
|
||||
# k = GPy.kern.linear(Q, ARD = True) + GPy.kern.white(Q, 0.00001)
|
||||
=======
|
||||
k = GPy.kern.bias(Q) #+ GPy.kern.white(Q)
|
||||
# k = GPy.kern.rbf(Q) + GPy.kern.rbf(Q) + GPy.kern.white(Q)
|
||||
# k = GPy.kern.rbf(Q) + GPy.kern.bias(Q) + GPy.kern.white(Q, 0.00001)
|
||||
k = GPy.kern.rbf(Q, ARD = False) + GPy.kern.white(Q, 0.00001)
|
||||
>>>>>>> master
|
||||
# k = GPy.kern.rbf(Q, ARD = False) + GPy.kern.white(Q, 0.00001)
|
||||
|
||||
m = GPy.models.Bayesian_GPLVM(Y, Q, kernel = k, M=M)
|
||||
m.constrain_positive('(rbf|bias|noise|white|S)')
|
||||
# m.constrain_fixed('S', 1)
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ m.constrain_positive('(rbf|bias|S|linear|white|noise)')
|
|||
# m.unconstrain('white')
|
||||
# m.constrain_bounded('white', 1e-6, 10.0)
|
||||
# plot_oil(m.X, np.array([1,1]), labels, 'PCA initialization')
|
||||
m.optimize(messages = True)
|
||||
# m.optimize(messages = True)
|
||||
# m.optimize('tnc', messages = True)
|
||||
plot_oil(m.X, m.kern.parts[0].lengthscale, labels, 'B-GPLVM')
|
||||
# plot_oil(m.X, m.kern.parts[0].lengthscale, labels, 'B-GPLVM')
|
||||
# # pb.figure()
|
||||
# m.plot()
|
||||
# pb.title('PCA initialisation')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue