60e8f88b9bbefc02c953e73d31e621d95dbcae82,GPy/kern/_src/rbf.py,RBF,gradients_qX_expectations,#RBF#Any#Any#Any#Any#Any#,106

Before Change


        return grad

    def gradients_qX_expectations(self, dL_dpsi0, dL_dpsi1, dL_dpsi2, Z, variational_posterior):
        mu = variational_posterior.mean
        S = variational_posterior.variance
        self._psi_computations(Z, mu, S)
        l2 = self.lengthscale **2
        //psi1
        tmp = self._psi1[:, :, None] / l2 / self._psi1_denom
        grad_mu = np.sum(dL_dpsi1[:, :, None] * tmp * self._psi1_dist, 1)
        grad_S = np.sum(dL_dpsi1[:, :, None] * 0.5 * tmp * (self._psi1_dist_sq - 1), 1)
        //psi2

After Change


        grad_mu = np.sum(dL_dpsi1[:, :, None] * tmp * dist, 1)
        grad_S = np.sum(dL_dpsi1[:, :, None] * 0.5 * tmp * (dist_sq - 1), 1)
        //psi2
        denom, Zdist, Zdist_sq, mudist, mudist_sq, psi2 = self._psi2computations(Z, variational_posterior)
        tmp = psi2[:, :, :, None] / l2 / denom[:,None,None,:]
        grad_mu += -2.*(dL_dpsi2[:, :, :, None] * tmp * mudist).sum(1).sum(1)
        grad_S += (dL_dpsi2[:, :, :, None] * tmp * (2.*mudist_sq - 1)).sum(1).sum(1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: SheffieldML/GPy
Commit Name: 60e8f88b9bbefc02c953e73d31e621d95dbcae82
Time: 2014-02-26
Author: james.hensman@gmail.com
File Name: GPy/kern/_src/rbf.py
Class Name: RBF
Method Name: gradients_qX_expectations


Project Name: SheffieldML/GPy
Commit Name: 60e8f88b9bbefc02c953e73d31e621d95dbcae82
Time: 2014-02-26
Author: james.hensman@gmail.com
File Name: GPy/kern/_src/rbf.py
Class Name: RBF
Method Name: gradients_qX_expectations


Project Name: SheffieldML/GPy
Commit Name: 60e8f88b9bbefc02c953e73d31e621d95dbcae82
Time: 2014-02-26
Author: james.hensman@gmail.com
File Name: GPy/kern/_src/rbf.py
Class Name: RBF
Method Name: psi2


Project Name: SheffieldML/GPy
Commit Name: 60e8f88b9bbefc02c953e73d31e621d95dbcae82
Time: 2014-02-26
Author: james.hensman@gmail.com
File Name: GPy/kern/_src/rbf.py
Class Name: RBF
Method Name: gradients_Z_expectations