d5e9eb8ee2987165648a1397e97198e2d20ff5b3,tensorly/decomposition/symmetric_parafac.py,,symmetric_parafac_power_iteration,#,76

Before Change


    if not tl.shape(tensor) == (size, )*order:
        raise ValueError("The input tensor does not have the same size along each mode.")

    factor = tl.zeros((size, rank), **tl.context(tensor))
    weigths = tl.zeros(rank, **tl.context(tensor))

    for i in range(rank):
        eigenval, eigenvec, deflated = symmetric_power_iteration(tensor, n_repeat=n_repeat, n_iteration=n_iteration, verbose=verbose)
        factor = tl.index_update(factor, tl.index[:, i], eigenvec)
        weigths = tl.index_update(weigths, tl.index[i], eigenval)
        tensor = deflated

    return weigths, factor

After Change



    for _ in range(rank):
        eigenval, eigenvec, deflated = symmetric_power_iteration(tensor, n_repeat=n_repeat, n_iteration=n_iteration, verbose=verbose)
        factor.append(eigenvec)
        weigths.append(eigenval)
        tensor = deflated

    factor = tl.stack(factor, axis=1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorly/tensorly
Commit Name: d5e9eb8ee2987165648a1397e97198e2d20ff5b3
Time: 2020-08-28
Author: jean.kossaifi@gmail.com
File Name: tensorly/decomposition/symmetric_parafac.py
Class Name:
Method Name: symmetric_parafac_power_iteration


Project Name: danielhomola/mifs
Commit Name: 9a2aae75c79ca2ea185dda22cd41340c5a6ef5a0
Time: 2018-10-30
Author: j.v.griethuysen@nki.nl
File Name: mifs/mifs.py
Class Name: MutualInformationFeatureSelector
Method Name: _fit


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 1a89404a84393211c7b370077fafe536a8f44762
Time: 2018-03-02
Author: max.lapan@gmail.com
File Name: ch17/lib/common.py
Class Name:
Method Name: iterate_batches


Project Name: MVIG-SJTU/AlphaPose
Commit Name: 2ab72370d6a613666508f8dfb9f28ac50186ed8f
Time: 2020-08-13
Author: 510641426@qq.com
File Name: trackers/__init__.py
Class Name:
Method Name: track