I am having some issues with sparse_encode, and am not sure if it is a bug
or my errror. In implementing a KSVDCoder, I have gotten something which
appears to work on one dataset. However, when I swap to a different
dataset, I begin to get errors, specifically:

ValueError: The number of atoms cannot be more than the number of features

However, as can be seen in the example, my number of atoms (D.shape[0]) is
less than the number of features (X.shape[1]) in both cases - way less!

Is this an error in the documentation issue or my lack of knowledge? Or is
there something different at work?


Minimal example which recreates my issue (these are dimensions from some
data I am using, or at least trying to...)


from sklearn.decomposition import sparse_encode
import numpy as np

#Works
X = np.random.randn(96600, 64)
D = np.random.randn(16, 64)
sparse_encode(X, D, algorithm='omp', n_nonzero_coefs=None)

#Broken?
X = np.random.randn(100, 64)
D = np.random.randn(2, 64)
sparse_encode(X, D, algorithm='omp', n_nonzero_coefs=None)
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to