130cbadff294b686e466d430f26b2d069f6bbf59,metric_learn/sdml.py,_BaseSDML,_fit,#_BaseSDML#Any#Any#,65

Before Change


                                    type_of_inputs="tuples")

    // set up (the inverse of) the prior M
    if self.use_cov:
      X = np.vstack({tuple(row) for row in pairs.reshape(-1, pairs.shape[2])})
      prior_inv = np.atleast_2d(np.cov(X, rowvar=False))
    else:
      prior_inv = np.identity(pairs.shape[2])
    diff = pairs[:, 0] - pairs[:, 1]
    loss_matrix = (diff.T * y).dot(diff)
    emp_cov = prior_inv + self.balance_param * loss_matrix

After Change


      prior = "identity"
    else:
      prior = self.prior
    _, prior_inv = _initialize_metric_mahalanobis(pairs, prior,
                                                  return_inverse=True,
                                                  strict_pd=True,
                                                  matrix_name="prior")
    diff = pairs[:, 0] - pairs[:, 1]
    loss_matrix = (diff.T * y).dot(diff)
    emp_cov = prior_inv + self.balance_param * loss_matrix
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: metric-learn/metric-learn
Commit Name: 130cbadff294b686e466d430f26b2d069f6bbf59
Time: 2019-06-07
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/sdml.py
Class Name: _BaseSDML
Method Name: _fit


Project Name: metric-learn/metric-learn
Commit Name: 130cbadff294b686e466d430f26b2d069f6bbf59
Time: 2019-06-07
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/lsml.py
Class Name: _BaseLSML
Method Name: _fit


Project Name: metric-learn/metric-learn
Commit Name: 130cbadff294b686e466d430f26b2d069f6bbf59
Time: 2019-06-07
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/itml.py
Class Name: _BaseITML
Method Name: _fit