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)
//math: beta_ols = inv(X.T*X)*X.T*y
//math: ols_fit = X*beta_ols*inv(y)
//ols_fit = np.dot(U, U.T)
ols_fit = _ols_fit_matrix(design_matrix)
min_diffusivity = tol / -design_matrix.min()
for param, sig in zip(dti_params, data_flat):
param[0], param[1:] = _wls_iter(ols_fit, design_matrix, sig,
min_diffusivity)
dti_params.shape = data.shape[:-1] + (12,)
return dti_params
After Change
min_diffusivity=tol / -design_matrix.min()
)
dti_params = np.concatenate((evals[..., None, :], evecs), axis=-2)
return dti_params.reshape(data.shape[:-1] + (12,))
def ols_fit_tensor(design_matrix, data):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
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: nipy/dipy
Commit Name: 4f3da275037d4fe3108039fdbfc03b2f81fbee8c
Time: 2015-10-15
Author: dimrozakis@gmail.com
File Name: dipy/reconst/dti.py
Class Name:
Method Name: ols_fit_tensor
Project Name: eriklindernoren/Keras-GAN
Commit Name: 6f90dac721f38b365ad87e1633860f53b9ca44db
Time: 2018-03-14
Author: eriklindernoren@gmail.com
File Name: discogan/data_loader.py
Class Name: DataLoader
Method Name: load_data