[mlpack-svn] r13105 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jun 25 16:22:39 EDT 2012
Author: rcurtin
Date: 2012-06-25 16:22:39 -0400 (Mon, 25 Jun 2012)
New Revision: 13105
Modified:
mlpack/trunk/src/mlpack/tests/sparse_coding_test.cpp
Log:
Formatting fix, and handle things a little more carefully.
Modified: mlpack/trunk/src/mlpack/tests/sparse_coding_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/sparse_coding_test.cpp 2012-06-25 09:01:02 UTC (rev 13104)
+++ mlpack/trunk/src/mlpack/tests/sparse_coding_test.cpp 2012-06-25 20:22:39 UTC (rev 13105)
@@ -111,7 +111,7 @@
uword nPoints = X.n_cols;
// Normalize each point since these are images.
- for(uword i = 0; i < nPoints; ++i)
+ for (uword i = 0; i < nPoints; ++i)
X.col(i) /= norm(X.col(i), 2);
SparseCoding<> sc(X, nAtoms, lambda1);
@@ -122,8 +122,8 @@
X = D * Z;
- SparseCoding<> sc2(X, nAtoms, lambda1);
-// sc.Data() = X;
+ // This will update sc.data (that is a reference to X).
+ DataDependentRandomInitializer::Initialize(X, nAtoms, sc.Dictionary());
uvec adjacencies = find(Z);
sc.OptimizeDictionary(adjacencies);
More information about the mlpack-svn
mailing list