Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
caglayantuna committed May 12, 2021
1 parent b74cbee commit aa5a4d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tensorly/decomposition/_tucker.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def non_negative_tucker_hals(tensor, rank, n_iter_max=100, init="svd", svd='nump
UtM = tl.transpose(MtU)

# Call the hals resolution with nnls, optimizing the current mode
nn_factor, _, _, _ = hals_nnls(UtM, UtU, tl.transpose(factors[mode]),
nn_factor, _, _, _ = hals_nnls(UtM, UtU, tl.transpose(nn_factors[mode]),
n_iter_max=100, sparsity_coefficient=sparsity_coefficients[mode],
exact=exact)
nn_factors[mode] = tl.transpose(nn_factor)
Expand All @@ -470,7 +470,6 @@ def non_negative_tucker_hals(tensor, rank, n_iter_max=100, init="svd", svd='nump
pseudo_inverse[-1] = tl.dot(tl.transpose(nn_factors[-1]), nn_factors[-1])
AtB = tl.base.tensor_to_vec(tl.tenalg.mode_dot(tensor_cross, tl.transpose(nn_factors[modes[-1]]), modes[-1]))
AtA = tl.tenalg.kronecker(pseudo_inverse)
nn_core = active_set_nnls(AtA, AtB, x=nn_core, n_iter_max=n_iter_max)
vectorcore = active_set_nnls(AtA, AtB, x=nn_core, n_iter_max=n_iter_max)
nn_core = tl.reshape(vectorcore, tl.shape(nn_core))

Expand Down

0 comments on commit aa5a4d7

Please sign in to comment.