13 #ifndef MLPACK_METHODS_LOCAL_COORDINATE_CODING_LCC_HPP 14 #define MLPACK_METHODS_LOCAL_COORDINATE_CODING_LCC_HPP 20 #include "../sparse_coding/nothing_initializer.hpp" 21 #include "../sparse_coding/data_dependent_random_initializer.hpp" 22 #include "../sparse_coding/random_initializer.hpp" 104 typename DictionaryInitializer =
110 const size_t maxIterations = 0,
111 const double tolerance = 0.01,
112 const DictionaryInitializer& initializer =
113 DictionaryInitializer());
128 const double lambda = 0.0,
129 const size_t maxIterations = 0,
130 const double tolerance = 0.01);
140 typename DictionaryInitializer =
143 double Train(
const arma::mat& data,
144 const DictionaryInitializer& initializer =
145 DictionaryInitializer());
153 void Encode(
const arma::mat& data, arma::mat& codes);
165 const arma::mat& codes,
166 const arma::uvec& adjacencies);
178 const arma::mat& codes,
179 const arma::uvec& adjacencies)
const;
182 size_t Atoms()
const {
return atoms; }
207 template<
typename Archive>
208 void serialize(Archive& ar,
const uint32_t );
215 arma::mat dictionary;
221 size_t maxIterations;
230 #include "lcc_impl.hpp" double & Lambda()
Modify the L1 regularization parameter.
Linear algebra utility functions, generally performed on matrices or vectors.
size_t MaxIterations() const
Get the maximum number of iterations.
double & Tolerance()
Modify the objective tolerance.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Encode(const arma::mat &data, arma::mat &codes)
Code each point via distance-weighted LARS.
size_t & Atoms()
Modify the number of atoms.
A data-dependent random dictionary initializer for SparseCoding.
arma::mat & Dictionary()
Mutator for dictionary.
An implementation of Local Coordinate Coding (LCC) that codes data which approximately lives on a man...
const arma::mat & Dictionary() const
Accessor for dictionary.
double Objective(const arma::mat &data, const arma::mat &codes, const arma::uvec &adjacencies) const
Compute objective function given the list of adjacencies.
double Tolerance() const
Get the objective tolerance.
double Train(const arma::mat &data, const DictionaryInitializer &initializer=DictionaryInitializer())
Run local coordinate coding.
void OptimizeDictionary(const arma::mat &data, const arma::mat &codes, const arma::uvec &adjacencies)
Learn dictionary by solving linear system.
size_t & MaxIterations()
Modify the maximum number of iterations.
void serialize(Archive &ar, const uint32_t)
Serialize the model.
size_t Atoms() const
Get the number of atoms.
LocalCoordinateCoding(const arma::mat &data, const size_t atoms, const double lambda, const size_t maxIterations=0, const double tolerance=0.01, const DictionaryInitializer &initializer=DictionaryInitializer())
Set the parameters to LocalCoordinateCoding, and train the dictionary.
double Lambda() const
Get the L1 regularization parameter.