mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-27 14:25:16 +02:00
fixed printing, some example
This commit is contained in:
parent
6d64559f1f
commit
6196ed794e
2 changed files with 5 additions and 2 deletions
|
|
@ -316,7 +316,10 @@ class model(parameterised):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
s = parameterised.__str__(self).split('\n')
|
s = parameterised.__str__(self).split('\n')
|
||||||
# add priors to the string
|
# add priors to the string
|
||||||
strs = [str(p) if p is not None else '' for p in self.priors]
|
if self.priors is not None:
|
||||||
|
strs = [str(p) if p is not None else '' for p in self.priors]
|
||||||
|
else:
|
||||||
|
strs = ['']*len(self._get_params())
|
||||||
width = np.array(max([len(p) for p in strs] + [5])) + 4
|
width = np.array(max([len(p) for p in strs] + [5])) + 4
|
||||||
|
|
||||||
log_like = self.log_likelihood()
|
log_like = self.log_likelihood()
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ def sparse_GP_regression_1D(N = 400, M = 5, max_nb_eval_optim=100):
|
||||||
# create simple GP model
|
# create simple GP model
|
||||||
m = GPy.models.sparse_GP_regression(X, Y, kernel, M=M)
|
m = GPy.models.sparse_GP_regression(X, Y, kernel, M=M)
|
||||||
|
|
||||||
m.constrain_positive('(variance|lengthscale|precision)')
|
m.ensure_default_constraints()
|
||||||
|
|
||||||
m.checkgrad(verbose=1)
|
m.checkgrad(verbose=1)
|
||||||
m.optimize('tnc', messages = 1, max_f_eval=max_nb_eval_optim)
|
m.optimize('tnc', messages = 1, max_f_eval=max_nb_eval_optim)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue