mlpack
|
#include <mlpack/prereqs.hpp>
#include <mlpack/core/util/io.hpp>
#include <mlpack/core/util/mlpack_main.hpp>
#include "lcc.hpp"
Functions | |
BINDING_NAME ("Local Coordinate Coding") | |
BINDING_SHORT_DESC ("An implementation of Local Coordinate Coding (LCC), a data transformation " "technique. Given input data, this transforms each point to be expressed " "as a linear combination of a few points in the dataset; once an LCC model " "is trained, it can be used to transform points later also.") | |
BINDING_LONG_DESC ("An implementation of Local Coordinate Coding (LCC), which " "codes data that approximately lives on a manifold using a variation of l1-" "norm regularized sparse coding. Given a dense data matrix X with n points" " and d dimensions, LCC seeks to find a dense dictionary matrix D with k " "atoms in d dimensions, and a coding matrix Z with n points in k " "dimensions. Because of the regularization method used, the atoms in D " "should lie close to the manifold on which the data points lie." "\" "The original data matrix X can then be reconstructed as D * Z. Therefore," " this program finds a representation of each point in X as a sparse linear" " combination of atoms in the dictionary D." "\" "The coding is found with an algorithm which alternates between a " "dictionary step, which updates the dictionary D, and a coding step, which " "updates the coding matrix Z." "\" "To run this program, the input matrix X must be specified (with -i), along" " with the number of atoms in the dictionary (-k). An initial dictionary " "may also be specified with the "+PRINT_PARAM_STRING("initial_dictionary")+" parameter. The l1-norm " "regularization parameter is specified with the "+PRINT_PARAM_STRING("lambda")+" parameter.") | |
BINDING_EXAMPLE ("For example, to run LCC on " "the dataset "+PRINT_DATASET("data")+" using 200 atoms and an " "l1-regularization parameter of 0.1, saving the dictionary "+PRINT_PARAM_STRING("dictionary")+" and the codes into "+PRINT_PARAM_STRING("codes")+", use" "\"+PRINT_CALL("local_coordinate_coding", "training", "data", "atoms", 200, "lambda", 0.1, "dictionary", "dict", "codes", "codes")+"\" "The maximum number of iterations may be specified with the "+PRINT_PARAM_STRING("max_iterations")+" parameter. " "Optionally, the input data matrix X can be normalized before coding with " "the "+PRINT_PARAM_STRING("normalize")+" parameter." "\" "An LCC model may be saved using the "+PRINT_PARAM_STRING("output_model")+" output parameter. Then, to encode " "new points from the dataset "+PRINT_DATASET("points")+" with the " "previously saved model "+PRINT_MODEL("lcc_model")+", saving the new " "codes to "+PRINT_DATASET("new_codes")+", the following command can " "be used:" "\"+PRINT_CALL("local_coordinate_coding", "input_model", "lcc_model", "test", "points", "codes", "new_codes")) | |
BINDING_SEE_ALSO ("@sparse_coding", "#sparse_coding") | |
BINDING_SEE_ALSO ("Nonlinear learning using local coordinate coding (pdf)", "https://papers.nips.cc/paper/3875-nonlinear-learning-using-local-" "coordinate-coding.pdf") | |
BINDING_SEE_ALSO ("mlpack::lcc::LocalCoordinateCoding C++ class documentation", "@doxygen/classmlpack_1_1lcc_1_1LocalCoordinateCoding.html") | |
PARAM_MATRIX_IN ("training", "Matrix of training data (X).", "t") | |
PARAM_INT_IN ("atoms", "Number of atoms in the dictionary.", "k", 0) | |
PARAM_DOUBLE_IN ("lambda", "Weighted l1-norm regularization parameter.", "l", 0.0) | |
PARAM_INT_IN ("max_iterations", "Maximum number of iterations for LCC (0 " "indicates no limit).", "n", 0) | |
PARAM_MATRIX_IN ("initial_dictionary", "Optional initial dictionary.", "i") | |
PARAM_FLAG ("normalize", "If set, the input data matrix will be normalized " "before coding.", "N") | |
PARAM_DOUBLE_IN ("tolerance", "Tolerance for objective function.", "o", 0.01) | |
PARAM_MODEL_IN (LocalCoordinateCoding, "input_model", "Input LCC model.", "m") | |
PARAM_MODEL_OUT (LocalCoordinateCoding, "output_model", "Output for trained LCC " "model.", "M") | |
PARAM_MATRIX_IN ("test", "Test points to encode.", "T") | |
PARAM_MATRIX_OUT ("dictionary", "Output dictionary matrix.", "d") | |
PARAM_MATRIX_OUT ("codes", "Output codes matrix.", "c") | |
PARAM_INT_IN ("seed", "Random seed. If 0, 'std::time(NULL)' is used.", "s", 0) | |
Executable for Local Coordinate Coding.
mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.