0c248e752052e18d2467d0e95f07046a666ae817,GPy/likelihoods/bernoulli.py,Bernoulli,moments_match_ep,#Bernoulli#Any#Any#Any#Any#,46

Before Change



        elif isinstance(self.gp_link, link_functions.Heaviside):
            a = sign*v_i/np.sqrt(tau_i)
            Z_hat = np.max(1e-13, std_norm_cdf(z))
            N = std_norm_pdf(a)
            mu_hat = v_i/tau_i + sign*N/Z_hat/np.sqrt(tau_i)
            sigma2_hat = (1. - a*N/Z_hat - np.square(N/Z_hat))/tau_i
        else:
            //TODO: do we want to revert to numerical quadrature here?

After Change


            raise ValueError("Exact moment matching not available for link {}".format(self.gp_link.__name__))

        // TODO: Output log_Z_hat instead of Z_hat (needs to be change in all others likelihoods)
        return np.exp(log_Z_hat), mu_hat, sigma2_hat

    def variational_expectations(self, Y, m, v, gh_points=None, Y_metadata=None):
        if isinstance(self.gp_link, link_functions.Probit):
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/likelihoods/bernoulli.py
Class Name: Bernoulli
Method Name: moments_match_ep


Project Name: allenai/allennlp
Commit Name: 455b2f3ad60adb9a173d87f59c363b000c516bc3
Time: 2017-08-01
Author: markn@allenai.org
File Name: allennlp/common/tensor.py
Class Name:
Method Name: masked_softmax


Project Name: SheffieldML/GPy
Commit Name: 63751de9127ab46ab0374507338e89cd3a1be78f
Time: 2017-06-01
Author: morepabl@amazon.com
File Name: GPy/likelihoods/bernoulli.py
Class Name: Bernoulli
Method Name: moments_match_ep