Skip to content

Commit

Permalink
Making build_predict function private.
Browse files Browse the repository at this point in the history
  • Loading branch information
awav committed Sep 14, 2017
1 parent e1aac18 commit d02c7f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gpflow/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,23 @@ def predict_f(self, Xnew):
Compute the mean and variance of the latent function(s) at the points
Xnew.
"""
return self.build_predict(Xnew)
return self._build_predict(Xnew)

@AutoFlow((TF_FLOAT_TYPE, [None, None]))
def predict_f_full_cov(self, Xnew):
"""
Compute the mean and covariance matrix of the latent function(s) at the
points Xnew.
"""
return self.build_predict(Xnew, full_cov=True)
return self._build_predict(Xnew, full_cov=True)

@AutoFlow((TF_FLOAT_TYPE, [None, None]), (tf.int32, []))
def predict_f_samples(self, Xnew, num_samples):
"""
Produce samples from the posterior latent function(s) at the points
Xnew.
"""
mu, var = self.build_predict(Xnew, full_cov=True)
mu, var = self._build_predict(Xnew, full_cov=True)
jitter = tf.eye(tf.shape(mu)[0], dtype=TF_FLOAT_TYPE) * settings.numerics.jitter_level
samples = []
for i in range(self.num_latent):
Expand All @@ -174,8 +174,8 @@ def predict_density(self, Xnew, Ynew):
ignoring correlations between them. The result is a matrix the same
shape as Ynew containing the log densities.
"""
pred_f_mean, pred_f_var = self.build_predict(Xnew)
pred_f_mean, pred_f_var = self._build_predict(Xnew)
return self.likelihood.predict_density(pred_f_mean, pred_f_var, Ynew)

def build_predict(self, *args, **kwargs):
def _build_predict(self, *args, **kwargs):
raise NotImplementedError

1 comment on commit d02c7f8

@javdrher
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is wrong with using e.g. build_predict to incorporate a GP model in a larger graph? I don't see a specific reason this should be private?

Please sign in to comment.