mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
coreg_spars fixed
This commit is contained in:
parent
601a9f8a7b
commit
527922264c
1 changed files with 3 additions and 7 deletions
|
|
@ -75,16 +75,12 @@ def coregionalization_sparse(max_iters=100):
|
||||||
Y2 = -np.sin(X2) + np.random.randn(*X2.shape) * 0.05
|
Y2 = -np.sin(X2) + np.random.randn(*X2.shape) * 0.05
|
||||||
Y = np.vstack((Y1, Y2))
|
Y = np.vstack((Y1, Y2))
|
||||||
|
|
||||||
num_inducing = 40
|
|
||||||
#Z = np.hstack((np.random.rand(num_inducing, 1) * 8, np.random.randint(0, 2, num_inducing)[:, None]))
|
|
||||||
|
|
||||||
k1 = GPy.kern.rbf(1)
|
k1 = GPy.kern.rbf(1)
|
||||||
|
|
||||||
m = GPy.models.SparseGPMultioutputRegression(X_list=[X1,X2],Y_list=[Y1,Y2],kernel_list=[k1],num_inducing=20)
|
m = GPy.models.SparseGPMultioutputRegression(X_list=[X1,X2],Y_list=[Y1,Y2],kernel_list=[k1],num_inducing=20)
|
||||||
#m.constrain_fixed('iip')
|
m.constrain_fixed('.*rbf_var',1.)
|
||||||
m.constrain_bounded('noise_variance', 1e-3, 1e-1)
|
m.optimize(messages=1)
|
||||||
# m.optimize_restarts(5, robust=True, messages=1, max_iters=max_iters, optimizer='bfgs')
|
#m.optimize_restarts(5, robust=True, messages=1, max_iters=max_iters, optimizer='bfgs')
|
||||||
m.optimize(max_iters=max_iters)
|
|
||||||
|
|
||||||
fig, axes = pb.subplots(2,1)
|
fig, axes = pb.subplots(2,1)
|
||||||
m.plot(output=0,ax=axes[0])
|
m.plot(output=0,ax=axes[0])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue