-
Notifications
You must be signed in to change notification settings - Fork 113
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
Implementation of CP-APR algorithm #27
base: master
Are you sure you want to change the base?
Conversation
Looks good - thanks! |
Thanks also @hskarpetis for its valuable contributions. |
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>
.
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factors need to be in reversed order I think
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