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):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: mozilla/TTS
Commit Name: b1935c97fa1175908c579a4db06214174253f5f4
Time: 2020-06-26
Author: erogol@hotmail.com
File Name: server/synthesizer.py
Class Name: Synthesizer
Method Name: tts