Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement additional methods for CPD #16

Open
3 of 11 tasks
Tracked by #6
dahong67 opened this issue Oct 11, 2023 · 0 comments
Open
3 of 11 tasks
Tracked by #6

Implement additional methods for CPD #16

dahong67 opened this issue Oct 11, 2023 · 0 comments

Comments

@dahong67
Copy link
Owner

dahong67 commented Oct 11, 2023

Some options:

  • destructuring, e.g., λ, (U1, U2, U3) = M where M::CPD
    For reference, this is how it's done for SVD:
    Base.iterate(S::SVD) = (S.U, Val(:S))
    Base.iterate(S::SVD, ::Val{:S}) = (S.S, Val(:V))
    Base.iterate(S::SVD, ::Val{:V}) = (S.V, Val(:done))
    Base.iterate(S::SVD, ::Val{:done}) = nothing
  • norm(M::CPD) = sqrt(sum(abs2,M[I] for I in CartesianIndices(size(M))))
  • *(a::Number, M::CPD)
  • /(M::CPD, a::Number)
  • normalize(M::CPD) = M/norm(M)
  • iterator over components (maybe spelled eachcomp) analogous to eachrow, eachcol, eachslice.
  • permuting/sorting the components (analogous to arrange in Tensor Toolbox)
  • permutedims (analogous to permute in Tensor Toolbox)
  • getcomp (analogous to getindex for AbstractArrays. see also extract in Tensor Toolbox)
  • Normalize components #64
  • Conversion to Array #57

Implementations in other packages/toolboxes:

@dahong67 dahong67 mentioned this issue Oct 11, 2023
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant