fa786e5f2a8016725991cf2d02eebe6368dc04b3,dipy/reconst/dti.py,,wls_fit_tensor,#Any#Any#,1154

Before Change


    tol = 1e-6
    data = np.asarray(data)
    data_flat = data.reshape((-1, data.shape[-1]))
    dti_params = np.empty((len(data_flat), 4, 3))

    //obtain OLS fitting matrix
    //U,S,V = np.linalg.svd(design_matrix, False)

After Change


    //ols_fit = np.dot(U, U.T)
    ols_fit = _ols_fit_matrix(design_matrix)

    log_s = np.log(data)
    w = np.exp(np.einsum("...ij,...j", ols_fit, log_s))
    evals, evecs = decompose_tensor(
        from_lower_triangular(
            np.einsum("...ij,...j",
                      pinv_vec(design_matrix * w[..., None]),
                      w * log_s)
        ),
        min_diffusivity=tol / -design_matrix.min()
    )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: nipy/dipy
Commit Name: fa786e5f2a8016725991cf2d02eebe6368dc04b3
Time: 2015-10-15
Author: dimrozakis@gmail.com
File Name: dipy/reconst/dti.py
Class Name:
Method Name: wls_fit_tensor


Project Name: geomstats/geomstats
Commit Name: 51e58b16b173db89aaaf974cb9c0eed00d6fd52a
Time: 2018-09-27
Author: ninamio78@gmail.com
File Name: geomstats/special_orthogonal_group.py
Class Name: SpecialOrthogonalGroup
Method Name: projection


Project Name: PIQuIL/QuCumber
Commit Name: 76b2432b1c1ee03c80895a5c7d49cde485323102
Time: 2019-12-22
Author: emerali@users.noreply.github.com
File Name: qucumber/nn_states/density_matrix.py
Class Name: DensityMatrix
Method Name: rotated_gradient