Skip to content

Commit

Permalink
Update print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
ziatdinovmax authored Mar 19, 2021
1 parent 736d61d commit 77c4494
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions gpim/gpreg/vgpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ def __init__(self,
self.num_batches = kwargs.get("num_batches", 1)
self.learning_rate = learning_rate
self.independent = independent
self.lscales, self.noise_all = [], []
self.lscales = []
self.hyperparams = {
"lengthscale": self.lscales,
"noise": self.noise_all,
"lengthscale": self.lscales, # need to add noise as well
}
self.verbose = verbose

Expand Down Expand Up @@ -182,8 +181,6 @@ def train(self, **kwargs):
else:
self.lscales.append(
self.model.covar_module.base_kernel.lengthscale.tolist()[0])
#self.noise_all.append(
# self.model.likelihood.noise_covar.noise.tolist())
if self.verbose == 2 and (i % 10 == 0 or i == self.iterations - 1):
print('iter: {} ...'.format(i),
'loss: {} ...'.format(np.around(loss.item(), 4)),
Expand All @@ -196,9 +193,8 @@ def train(self, **kwargs):
print('training completed in {} s'.format(
np.round(time.time() - start_time, 2)))
print('Final parameter values:\n',
'lengthscale: {}, noise: {}'.format(
'lengthscale: {}'.format(
np.around(self.lscales[-1], 4)))
#np.around(self.noise_all[-1], 7)))
return

def predict(self, Xtest=None, **kwargs):
Expand Down

0 comments on commit 77c4494

Please sign in to comment.