[mlpack-svn] r13054 - mlpack/trunk/src/mlpack/methods/sparse_coding

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jun 13 17:42:44 EDT 2012


Author: rcurtin
Date: 2012-06-13 17:42:44 -0400 (Wed, 13 Jun 2012)
New Revision: 13054

Modified:
   mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp
Log:
Clean up comments, and store a reference to the data, instead of copying it.


Modified: mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp	2012-06-13 18:28:47 UTC (rev 13053)
+++ mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp	2012-06-13 21:42:44 UTC (rev 13054)
@@ -30,11 +30,15 @@
  * each column is a point and each row is a dimension. The dictionary D is a
  * d-by-k matrix, and the sparse codes matrix Z is a k-by-m matrix.
  * This program seeks to minimize the objective:
- * min_{D,Z} 0.5 ||X - D Z||_{Fro}^2\ + lambda_1 sum_{i=1}^m ||Z_i||_1
- *                                    + 0.5 lambda_2 sum_{i=1}^m ||Z_i||_2^2
- * subject to ||D_j||_2 <= 1 for 1 <= j <= k
- * where typically lambda_1 > 0 and lambda_2 = 0.
  *
+ * \f[
+ * \min_{D,Z} 0.5 ||X - D Z||_{F}^2\ + \lambda_1 \sum_{i=1}^m ||Z_i||_1
+ *                                    + 0.5 \lambda_2 \sum_{i=1}^m ||Z_i||_2^2
+ * \f]
+ *
+ * subject to \f$ ||D_j||_2 <= 1 \f$ for \f$ 1 <= j <= k \f$
+ * where typically \f$ lambda_1 > 0 \f$ and \f$ lambda_2 = 0 \f$.
+ *
  * This problem is solved by an algorithm that alternates between a dictionary
  * learning step and a sparse coding step. The dictionary learning step updates
  * the dictionary D using a Newton method based on the Lagrange dual (see the
@@ -165,10 +169,10 @@
   //! Number of atoms.
   size_t atoms;
 
-  //! data (columns are points).
-  arma::mat data;
+  //! Data matrix (columns are points).
+  const arma::mat& data;
 
-  //! dictionary (columns are atoms).
+  //! Dictionary (columns are atoms).
   arma::mat dictionary;
 
   //! Sparse codes (columns are points).




More information about the mlpack-svn mailing list