33ee09c30ce5979b5f5074e08510a31ef5fa663c,cde/density_estimator/LSCDE.py,LSConditionalDensityEstimation,_pdf,#LSConditionalDensityEstimation#Any#Any#,151

Before Change


    X_normalized, Y_normalized = self._normalize(X, Y)

    p = np.dot(self.alpha.T, self._gaussian_kernel(X_normalized, Y_normalized).T)
    p_normalization = (np.sqrt(2 * np.pi) * self.bandwidth) ** self.ndim_y * np.dot(self.alpha.T,
                                                                                    self._gaussian_kernel(X_normalized).T)
    return np.squeeze(p / p_normalization / np.product(self.y_std))

  def _normalize(self, X, Y):
    X_normalized = (X - self.x_mean) / self.x_std
    Y_normalized = (Y - self.y_mean) / self.y_std

After Change


    return X, Y

  def _pdf(self, X, Y):
   return np.exp(self._log_pdf(X, Y))

  def _log_pdf(self, X, Y):
    X_normalized, Y_normalized = self._normalize(X, Y)
    log_p = logsumexp(np.log(self.alpha.T) + self._log_gaussian_kernel(X_normalized, Y_normalized), axis=1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: freelunchtheorem/Conditional_Density_Estimation
Commit Name: 33ee09c30ce5979b5f5074e08510a31ef5fa663c
Time: 2019-01-30
Author: jonas.rothfuss@gmx.de
File Name: cde/density_estimator/LSCDE.py
Class Name: LSConditionalDensityEstimation
Method Name: _pdf


Project Name: SPFlow/SPFlow
Commit Name: 178553d4d4edfdc155d876c5ac75aaa1105445ee
Time: 2018-08-15
Author: molina@cs.tu-darmstadt.de
File Name: src/spn/structure/leaves/conditional/utils.py
Class Name:
Method Name: get_scipy_obj_params


Project Name: SPFlow/SPFlow
Commit Name: c52045a02486d7c3793b1083f5b281a1e5fdb4fb
Time: 2018-09-11
Author: molina@cs.tu-darmstadt.de
File Name: src/spn/structure/leaves/conditional/utils.py
Class Name:
Method Name: get_scipy_obj_params