mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 19:42:39 +02:00
UPD: Added testing, and bug fixing.
This commit is contained in:
parent
9c07bd167c
commit
93e8b71f60
9 changed files with 6084 additions and 4248 deletions
|
|
@ -2,36 +2,11 @@ import GPy
|
|||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
import GPy.models.state_space_new as SS_new
|
||||
import GPy.models.state_space_model as SS_model
|
||||
|
||||
X = np.linspace(0, 10, 2000)[:, None]
|
||||
Y = np.sin(X) + np.random.randn(*X.shape)*0.1
|
||||
|
||||
# Need to run these lines when X and Y are imported ->
|
||||
#X.shape = (X.shape[0],1)
|
||||
#Y.shape = (Y.shape[0],1)
|
||||
# Need to run these lines when X and Y are imported <-
|
||||
|
||||
## Generation of minimal example data ->
|
||||
#X = np.random.rand(3)
|
||||
#sort_index = np.argsort(X)
|
||||
#X = X[sort_index]; X.shape = (X.shape[0],1)
|
||||
#Y = np.sin(10*X) + np.random.randn(*X.shape)*0.1
|
||||
## Generation of minimal example data <-
|
||||
|
||||
#plt.figure()
|
||||
#plt.plot( X, Y)
|
||||
#plt.show()
|
||||
|
||||
kernel = GPy.kern.Matern32(X.shape[1])
|
||||
m = GPy.models.StateSpace(X,Y, kernel)
|
||||
|
||||
print m
|
||||
#
|
||||
m.optimize(optimizer='bfgs',messages=True)
|
||||
#
|
||||
print m
|
||||
|
||||
kernel1 = GPy.kern.Matern32(X.shape[1])
|
||||
m1 = GPy.models.GPRegression(X,Y, kernel1)
|
||||
|
||||
|
|
@ -40,9 +15,9 @@ m1.optimize(optimizer='bfgs',messages=True)
|
|||
|
||||
print m1
|
||||
|
||||
kernel2 = GPy.kern.Matern32(X.shape[1])
|
||||
m2 = SS_new.StateSpace(X,Y, kernel2)
|
||||
|
||||
kernel2 = GPy.kern.sde_Matern32(X.shape[1])
|
||||
#m2 = SS_model.StateSpace(X,Y, kernel2)
|
||||
m2 = GPy.models.StateSpace(X,Y, kernel2)
|
||||
print m2
|
||||
|
||||
m2.optimize(optimizer='bfgs',messages=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue