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
        tmp = self._psi2[:, :, :, None] / l2 / self._psi2_denom
        grad_mu += -2.*(dL_dpsi2[:, :, :, None] * tmp * self._psi2_mudist).sum(1).sum(1)
        grad_S += (dL_dpsi2[:, :, :, None] * tmp * (2.*self._psi2_mudist_sq - 1)).sum(1).sum(1)

        return grad_mu, grad_S

After Change


    def gradients_qX_expectations(self, dL_dpsi0, dL_dpsi1, dL_dpsi2, Z, variational_posterior):
        l2 = self.lengthscale **2
        //psi1
        denom, dist, dist_sq, psi1 = self._psi1computations(Z, variational_posterior)
        tmp = psi1[:, :, None] / l2 / denom
        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
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: gradients_Z_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: psi1