Fixed two small lbugs

This commit is contained in:
Siivola Eero 2017-07-04 13:18:06 +03:00
parent 8377d95fbe
commit 8ad774cb4e
2 changed files with 2 additions and 2 deletions

View file

@ -175,7 +175,7 @@ class EP(EPBase, ExactGaussianInference):
if self.ep_mode=="nested":
#Force EP at each step of the optimization
self._ep_approximation = None
post_params, ga_approx, log_Z_tilde = self._ep_approximation = self.expectation_propagation(K, Y, likelihood, Y_metadata)
post_params, ga_approx, cav_params, log_Z_tilde = self._ep_approximation = self.expectation_propagation(K, Y, likelihood, Y_metadata)
elif self.ep_mode=="alternated":
if getattr(self, '_ep_approximation', None) is None:
#if we don't yet have the results of runnign EP, run EP and store the computed factors in self._ep_approximation

View file

@ -60,7 +60,7 @@ class Gaussian(Likelihood):
def ep_gradients(self, Y, cav_tau, cav_v, dL_dKdiag,Y_metadata=None):
return self.exact_inference_gradients(dL_dKdiag)
def exact_inference_gradients(self, dL_dKdiag):
def exact_inference_gradients(self, dL_dKdiag, Y_metadata=None):
return dL_dKdiag.sum()
def _preprocess_values(self, Y):