Hi,
 
I am trying to make the K-SVD implementation consistent with the existing sparse coding algorigthms (dict_learning and orthogonal_mp) and I am a bit confused by the notations. I'll give a summary of the notations and explain what I am not understanding.
 
1) sklearn.decomposition.dict_learning
 
Problem: X ~ CD, where
X : (n_samples, n_features) - training samples (as rows);
D : (n_components, n_features) - dictionary;
C : (n_samples, n_components) - sparse codes.
 
In the sparse coding papers the common notation is the following: X ~ DC, where
X : (n_features_1, n_samples) - training samples (as columns);
D : (n_features_1, n_features_2) - dictionary;
C : (n_features_2, n_samples) - sparse codes.
 
If I understand correctly, the training samples are placed as rows for the consistency with the rest of the library and machine learning papers' notation. So all the matrices are just transposed and everything is ok.
 
2) sklearn.linear_model.orthogonal_mp
 
Problem: y ~ Xc, where
y : (n_samples,) - the input vector;
X : (n_samples, n_features) - dictionary;
c : (n_features,) - the sparse code.
 
Sparse coding papers notation: y ~ Xc, where
y : (n_features_1,) - the input vector;
X : (n_features_1, n_features_2) - dictionary;
c : (n_features_2,) - the sparse code.
 
To the contrary to the dict_learning function the matrices are not transposed and the input vector is a column. Additionaly, the same entity (features_1) is named differently in dict_learning (features) and orthogonal_mp (samples). 
 
23.09.2014, 17:24, "Умнов Алексей (Alexey Umnov)" <alexe...@ya.ru>:

Thanks, the code and the link will be helpful indeed!

Alright, I am starting to work on the subject and will make a PR in some time.

23.09.2014, 16:17, "Kyle Kastner" <kastnerk...@gmail.com>:

 I started some code here long ago
 (https://gist.github.com/kastnerkyle/8143030) that isn't really
 finished or cleaned up - maybe it can give you some ideas/advice for
 implementing? I never got a chance to clean this up for PR, and it
 doesn't look like I will have time in the near future so your PR is
 most welcome!

 You are welcome to use this as a starting ground, or just start from
 scratch either way is great.

 This link was very helpful for me
 http://www.ux.uis.no/~karlsk/dle/#ssec32

 I would be interested in it as well, especially a good example
 comparing to the existing dictionary learning stuff in the lib.

 Kyle

 On Tue, Sep 23, 2014 at 6:55 AM, Gael Varoquaux
 <gael.varoqu...@normalesup.org> wrote:
  Hi Alexei,

  This is a well-known algorithm. I personnally think that it would be
  interesting to see it in scikit-learn. Therefor I would definitely
  welcome a pull request implementing it.

  Cheers,

  Gaël

  On Tue, Sep 23, 2014 at 02:44:14PM +0400, Умнов Алексей wrote:
  Hello,
  Is there anyone currently working on the K-SVD algorithm? If not, I can implement it, as I need it for my research anyway and there is already a good Orthogonal Matching Pursuit implementation in the library.
  ------------------------------------------------------------------------------
  Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
  Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
  Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
  Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
  http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
  _______________________________________________
  Scikit-learn-general mailing list
  Scikit-learn-general@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
 ------------------------------------------------------------------------------
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
 http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
 _______________________________________________
 Scikit-learn-general mailing list
 Scikit-learn-general@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

--
Alexey Umnov

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

 
 
--
Alexey Umnov
 
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to