0c248e752052e18d2467d0e95f07046a666ae817,GPy/inference/latent_function_inference/expectation_propagation.py,EP,inference,#EP#Any#Any#Any#Any#Any#Any#Any#Any#,52
Before Change
//if we"ve already run EP, just use the existing approximation stored in self._ep_approximation
mu, Sigma, mu_tilde, tau_tilde, Z_tilde = self._ep_approximation
return super(EP, self).inference(kern, X, likelihood, mu_tilde[:,None], mean_function=mean_function, Y_metadata=Y_metadata, variance=1./tau_tilde, K=K, Z_tilde=np.log(Z_tilde).sum())
def expectation_propagation(self, K, Y, likelihood, Y_metadata):
num_data, data_dim = Y.shape
After Change
if K is None:
K = kern.K(X)
if self.ep_mode=="nested":
//Force EP at each step of the optimization
self._ep_approximation = None
mu, Sigma, mu_tilde, tau_tilde, 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
mu, Sigma, mu_tilde, tau_tilde, log_Z_tilde = self._ep_approximation = self.expectation_propagation(K, Y, likelihood, Y_metadata)
else:
//if we"ve already run EP, just use the existing approximation stored in self._ep_approximation
mu, Sigma, mu_tilde, tau_tilde, log_Z_tilde = self._ep_approximation
else:
raise ValueError("ep_mode value not valid")
v_tilde = mu_tilde * tau_tilde
return self._inference(K, tau_tilde, v_tilde, likelihood, Y_metadata=Y_metadata, Z_tilde=log_Z_tilde.sum())
def expectation_propagation(self, K, Y, likelihood, Y_metadata):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 8
Instances
Project Name: SheffieldML/GPy
Commit Name: 0c248e752052e18d2467d0e95f07046a666ae817
Time: 2017-03-22
Author: morepabl@amazon.com
File Name: GPy/inference/latent_function_inference/expectation_propagation.py
Class Name: EP
Method Name: inference
Project Name: SheffieldML/GPy
Commit Name: 63751de9127ab46ab0374507338e89cd3a1be78f
Time: 2017-06-01
Author: morepabl@amazon.com
File Name: GPy/inference/latent_function_inference/expectation_propagation.py
Class Name: EP
Method Name: inference
Project Name: keras-team/keras
Commit Name: e94a6641dccda6dd7f8ad86fad82e62388548777
Time: 2021-01-06
Author: scottzhu@google.com
File Name: keras/initializers/initializers_v2.py
Class Name: Zeros
Method Name: __call__
Project Name: keras-team/keras
Commit Name: e94a6641dccda6dd7f8ad86fad82e62388548777
Time: 2021-01-06
Author: scottzhu@google.com
File Name: keras/initializers/initializers_v2.py
Class Name: Ones
Method Name: __call__