Incorrect implementation
Closed this issue · 2 comments
The end result of K-SVD should give X ~ dictionary.dot(gamma), not X ~ gamma.dot(dictionary) as you claim. There are several places in the code where things are transposed or reversed for some reason (lines 39, 57, 58 in init.py are a few).
PS - Sorry, nevermind. I think my problem was that you implemented things using data in rows instead of columns (like the paper and python would).
Thanks for your comment.
If I remember correctly, I tried implementing so that the interface had X ~ gamma.dot(dictionary) (as you mentioned in first row) at first.
But some decomposition algorithms in scikit-learn have reversed interface of above, and I wanted the interface to have the same interface of these algorithms.
Consequently, I implemented so that the interface has X ~ dictionary.got(gamma) (as you mentioned in PS)
I think it doesn't matter. This is a good implementation that helps me a lot. Thank you.