Open
Conversation
|
Looks good - thanks! |
Author
|
Thanks also @hskarpetis for its valuable contributions. |
Owner
|
Thanks for the contribution! It would be nice to have a small test case to check for correctness of the factorization. For instance, we can check the factors for a tensor where we know the correct factorization via numpy.allclose() We can load matlab files via scipy.io. So checking against matlab results would work. |
|
Will do - I'll try a few fabricated examples of various ranks and tensor
orders, likely before Monday. I'm also curious to see Marble (
http://ideal.ece.utexas.edu/pubs/pdf/2014/Marble-kdd14.pdf) because I'm not
grokking why it isn't the same as adding one more rank.
…On Sat, Nov 26, 2016 at 11:00 AM, Maximilian Nickel < ***@***.***> wrote:
Thanks for the contribution!
It would be nice to have a small test case to check for correctness of the
factorization. For instance, we can check the factors for a tensor where we
know the correct factorization via numpy.allclose()
We can load matlab files via scipy.io. So checking against matlab results
would work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFAFnh5q21J8CoTqx2xQfDl1y1eWgTtiks5rCFeLgaJpZM4K8vLn>
.
|
sktensor/cp.py
Outdated
| for j in range(inner_iter): | ||
| phi[n] = np.dot(X.unfold(n) / np.maximum(np.dot(b, pi), e), | ||
| pi.transpose()) | ||
| if np.amax(np.abs(np.ravel(np.minimum(M.U[n], 1-phi[n])))) < t: |
There was a problem hiding this comment.
Here do we need b instead of M.U[n] to match the paper? The paper has a small floor on M.U[n] also to keep zeros from entering in.
sktensor/cp.py
Outdated
| S[(phi[n] > 1) & (M.U[n] < k_tol)] = k | ||
| b = np.dot((M.U[n] + S), np.diag(M.lmbda)) | ||
| pi = khatrirao(tuple( | ||
| [M.U[i] for i in range(n) + range(n + 1, N)])).transpose() |
There was a problem hiding this comment.
Factors need to be in reversed order I think
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CP-APR algorithm
https://arxiv.org/pdf/1112.2414.pdf
The results of this implementation were tested against of that of MATLAB tensor toolbox, using the method described here.
https://pdfs.semanticscholar.org/71b5/d7ad21cf479c0816b9df00b19df87f8787a1.pdf