[mlpack-svn] r11679 - mlpack/trunk/src/mlpack/methods/sparse_coding
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Mar 1 01:45:30 EST 2012
Author: niche
Date: 2012-03-01 01:45:30 -0500 (Thu, 01 Mar 2012)
New Revision: 11679
Modified:
mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.cpp
mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp
Log:
added modifier (setter) for data X
Modified: mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.cpp 2012-03-01 06:44:27 UTC (rev 11678)
+++ mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.cpp 2012-03-01 06:45:30 UTC (rev 11679)
@@ -56,11 +56,16 @@
{ /* nothing left to do */ }
-void SparseCoding::SetDictionary(const mat& D) {
- matD = D;
+void SparseCoding::SetData(const mat& matX) {
+ this -> matX = matX;
}
+void SparseCoding::SetDictionary(const mat& matD) {
+ this -> matD = matD;
+}
+
+
void SparseCoding::InitDictionary() {
DataDependentRandomInitDictionary();
}
@@ -152,7 +157,6 @@
matGram = trans(matD) * matD;
}
-
for(u32 i = 0; i < nPoints; i++) {
// report progress
if((i % 100) == 0) {
Modified: mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp 2012-03-01 06:44:27 UTC (rev 11678)
+++ mlpack/trunk/src/mlpack/methods/sparse_coding/sparse_coding.hpp 2012-03-01 06:45:30 UTC (rev 11679)
@@ -170,6 +170,9 @@
// accessors, modifiers, printers
+ //! Modifier for matX
+ void SetData(const arma::mat& matX);
+
//! Modifier for matD
void SetDictionary(const arma::mat& matD);
More information about the mlpack-svn
mailing list