Skip to content

Commit

Permalink
Rename benchmark file (new)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmul1114 committed Feb 29, 2024
1 parent 9b25f93 commit a9f9d2a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/gcp-opt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,10 @@ function gcp_grad_U!(
I in CartesianIndices(X)
]
# Use faster MTTKRPs algorithm
#faster_mttkrps!(GU, M, Y)
#return ntuple(Val(N)) do k
# return rmul!(GU[k], Diagonal(M.λ))
#end
# MTTKRPs (inefficient but simple)
faster_mttkrps!(GU, M, Y)
return ntuple(Val(N)) do k
Yk = reshape(PermutedDimsArray(Y, [k; setdiff(1:N, k)]), size(X, k), :)
Zk = similar(Yk, prod(size(X)[setdiff(1:N, k)]), ncomponents(M))
for j in Base.OneTo(ncomponents(M))
Zk[:, j] = reduce(kron, [view(M.U[i], :, j) for i in reverse(setdiff(1:N, k))])
end
mul!(GU[k], Yk, Zk)
return rmul!(GU[k], Diagonal(M.λ))
end
end
end

function _gcp(
Expand Down

0 comments on commit a9f9d2a

Please sign in to comment.