mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-29 06:46:22 +02:00
Scale factor added to sparse_GP_regression
and sparse_GP_demo ammended to be less annoying (m1)
This commit is contained in:
parent
9f05744374
commit
126b45673b
2 changed files with 61 additions and 52 deletions
|
|
@ -11,8 +11,8 @@ import numpy as np
|
|||
import GPy
|
||||
np.random.seed(2)
|
||||
pb.ion()
|
||||
N = 500
|
||||
M = 5
|
||||
N = 1200
|
||||
M = 20
|
||||
|
||||
######################################
|
||||
## 1 dimensional example
|
||||
|
|
@ -27,20 +27,21 @@ noise = GPy.kern.white(1)
|
|||
kernel = rbf + noise
|
||||
|
||||
# create simple GP model
|
||||
m1 = GPy.models.sparse_GP_regression(X, Y, kernel, M=M)
|
||||
m = GPy.models.sparse_GP_regression(X, Y, kernel, M=M)
|
||||
|
||||
# contrain all parameters to be positive
|
||||
m1.constrain_positive('(variance|lengthscale|precision)')
|
||||
#m1.constrain_positive('(variance|lengthscale)')
|
||||
#m1.constrain_fixed('prec',10.)
|
||||
m.constrain_positive('(variance|lengthscale|precision)')
|
||||
#m.constrain_positive('(variance|lengthscale)')
|
||||
#m.constrain_fixed('prec',10.)
|
||||
|
||||
|
||||
#check gradient FIXME unit test please
|
||||
m1.checkgrad()
|
||||
m.checkgrad(verbose=1)
|
||||
stop
|
||||
# optimize and plot
|
||||
m1.optimize('tnc', messages = 1)
|
||||
m1.plot()
|
||||
# print(m1)
|
||||
m.optimize('tnc', messages = 1)
|
||||
m.plot()
|
||||
# print(m)
|
||||
|
||||
######################################
|
||||
## 2 dimensional example
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue