Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
dahong67 committed Aug 15, 2024
1 parent 2ed49f2 commit 7323423
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cpd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ function norm2(M::CPD{T,N}) where {T,N}
return sqrt(abs(M.λ' * V * M.λ))
end

"""
normalizecomps(M::CPD, p::Real = 2)
Normalize the components of `M` so that the columns of all its factor matrices
all have `p`-norm equal to unity, i.e., `norm(M.U[k][:, j], p) == 1` for all
`k ∈ 1:ndims(M)` and `j ∈ 1:ncomps(M)`. The excess weight is absorbed into `M.λ`.
"""
function normalizecomps(M::CPD, p::Real = 2)
weights = M.λ[:]

Expand Down

0 comments on commit 7323423

Please sign in to comment.