48e5569ebc13b3d5fc42e3efebcddd75a96ff241,tensorly/backend/core.py,Backend,partial_svd,#Backend#Any#Any#Any#,726
Before Change
else:
// We can perform a partial SVD
// construct np.random.RandomState for sampling a starting vector
if random_state is None:
// if random_state is not specified, do not initialize a starting vector
v0 = None
elif isinstance(random_state, int):
rns = np.random.RandomState(random_state)
// initilize with [-1, 1] as in ARPACK
v0 = rns.uniform(-1, 1, min_dim)
elif isinstance(random_state, np.random.RandomState):
// initilize with [-1, 1] as in ARPACK
v0 = random_state.uniform(-1, 1, min_dim)
// First choose whether to use X * X.T or X.T *X
if dim_1 < dim_2:
S, U = scipy.sparse.linalg.eigsh(
np.dot(matrix, matrix.T.conj()), k=n_eigenvecs, which="LM", v0=v0
)
After Change
U, S, V = U[:, :n_eigenvecs], S[:n_eigenvecs], V[:n_eigenvecs, :]
else:
// We can perform a partial SVD
rng = self.check_random_state(random_state)
// initilize with [-1, 1] as in ARPACK
v0 = rng.uniform(-1, 1, min_dim)
// First choose whether to use X * X.T or X.T *X
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances Project Name: tensorly/tensorly
Commit Name: 48e5569ebc13b3d5fc42e3efebcddd75a96ff241
Time: 2020-12-22
Author: merajhashemi@yahoo.co.uk
File Name: tensorly/backend/core.py
Class Name: Backend
Method Name: partial_svd
Project Name: tensorly/tensorly
Commit Name: 48e5569ebc13b3d5fc42e3efebcddd75a96ff241
Time: 2020-12-22
Author: merajhashemi@yahoo.co.uk
File Name: tensorly/backend/core.py
Class Name: Backend
Method Name: partial_svd
Project Name: scipy/scipy
Commit Name: e4cfcbf4b7994278186d4537f5c1edd8fa93e609
Time: 2020-04-26
Author: andyfaff@gmail.com
File Name: scipy/sparse/construct.py
Class Name:
Method Name: random
Project Name: ysig/GraKeL
Commit Name: 0f97477d8a8678ea445db039ac69effa3534acd7
Time: 2018-10-31
Author: y.siglidis@gmail.com
File Name: grakel/datasets/testing.py
Class Name:
Method Name: generate_dataset