Man page - mlpack_sparse_coding(1)
Packages contains this manual
- mlpack_fastmks(1)
- mlpack_mean_shift(1)
- mlpack_hmm_generate(1)
- mlpack_local_coordinate_coding(1)
- mlpack_sparse_coding(1)
- mlpack_preprocess_scale(1)
- mlpack_kmeans(1)
- mlpack_linear_svm(1)
- mlpack_preprocess_split(1)
- mlpack_softmax_regression(1)
- mlpack_hmm_train(1)
- mlpack_nca(1)
- mlpack_range_search(1)
- mlpack_radical(1)
- mlpack_gmm_generate(1)
- mlpack_cf(1)
- mlpack_random_forest(1)
- mlpack_lmnn(1)
- mlpack_gmm_probability(1)
- mlpack_emst(1)
- mlpack_dbscan(1)
- mlpack_nbc(1)
- mlpack_preprocess_one_hot_encoding(1)
- mlpack_lsh(1)
- mlpack_knn(1)
- mlpack_kde(1)
- mlpack_hoeffding_tree(1)
- mlpack_adaboost(1)
- mlpack_hmm_loglik(1)
- mlpack_nmf(1)
- mlpack_pca(1)
- mlpack_bayesian_linear_regression(1)
- mlpack_hmm_viterbi(1)
- mlpack_preprocess_describe(1)
- mlpack_decision_tree(1)
- mlpack_krann(1)
- mlpack_det(1)
- mlpack_lars(1)
- mlpack_preprocess_binarize(1)
- mlpack_logistic_regression(1)
- mlpack_gmm_train(1)
- mlpack_perceptron(1)
- mlpack_preprocess_imputer(1)
- mlpack_kernel_pca(1)
- mlpack_kfn(1)
- mlpack_linear_regression(1)
- mlpack_approx_kfn(1)
apt-get install mlpack-bin
Manual
mlpack_sparse_coding
NAMESYNOPSIS
DESCRIPTION
OPTIONAL INPUT OPTIONS
OPTIONAL OUTPUT OPTIONS
ADDITIONAL INFORMATION
NAME
mlpack_sparse_coding - sparse coding
SYNOPSIS
mlpack_sparse_coding [ -k int ] [ -i unknown ] [ -m unknown ] [ -l double ] [ -L double ] [ -n int ] [ -w double ] [ -N bool ] [ -o double ] [ -s int ] [ -T unknown ] [ -t unknown ] [ -V bool ] [ -c unknown ] [ -d unknown ] [ -M unknown ] [ -h -v ]
DESCRIPTION
An implementation of Sparse Coding with Dictionary Learning, which achieves sparsity via an l1-norm regularizer on the codes (LASSO) or an (l1+l2) -norm regularizer on the codes (the Elastic Net). Given a dense data matrix X with d dimensions and n points, sparse coding seeks to find a dense dictionary matrix D with k atoms in d dimensions, and a sparse coding matrix Z with n points in k dimensions.
The original data matrix X can then be reconstructed as Z * D. Therefore, this program finds a representation of each point in X as a sparse linear combination of atoms in the dictionary D.
The sparse coding is found with an algorithm which alternates between a dictionary step, which updates the dictionary D, and a sparse coding step, which updates the sparse coding matrix.
Once a dictionary D is found, the sparse coding model may be used to encode other matrices, and saved for future usage.
To run this program, either an input matrix or an already-saved sparse coding model must be specified. An input matrix may be specified with the ’ --training_file ( -t )’ option, along with the number of atoms in the dictionary (specified with the ’ --atoms ( -k )’ parameter). It is also possible to specify an initial dictionary for the optimization, with the ’ --initial_dictionary_file ( -i )’ parameter. An input model may be specified with the ’ --input_model_file ( -m )’ parameter.
As an example, to build a sparse coding model on the dataset ’data.csv’ using 200 atoms and an l1-regularization parameter of 0.1, saving the model into ’model.bin’, use
$ mlpack_sparse_coding --training_file data.csv --atoms 200 --lambda1 0.1 --output_model_file model.bin
Then, this model could be used to encode a new matrix, ’otherdata.csv’, and save the output codes to ’codes.csv’:
$ mlpack_sparse_coding --input_model_file model.bin --test_file otherdata.csv --codes_file codes.csv
OPTIONAL INPUT OPTIONS
--atoms (-k) [ int ]
Number of atoms in the dictionary. Default value 15.
--help (-h) [ bool ]
Default help info.
--info [string]
Print help on a specific option. Default value ’’.
--initial_dictionary_file (-i) [ unknown ]
Optional initial dictionary matrix.
--input_model_file (-m) [ unknown ]
File containing input sparse coding model.
--lambda1 (-l) [ double ]
Sparse coding l1-norm regularization parameter. Default value 0.
--lambda2 (-L) [ double ]
Sparse coding l2-norm regularization parameter. Default value 0.
--max_iterations (-n) [ int ]
Maximum number of iterations for sparse coding (0 indicates no limit). Default value 0.
--newton_tolerance (-w) [ double ]
Tolerance for convergence of Newton method. Default value 1e-06.
--normalize (-N) [ bool ]
If set, the input data matrix will be normalized before coding.
--objective_tolerance (-o) [ double ]
Tolerance for convergence of the objective function. Default value 0.01.
--seed (-s) [ int ]
Random seed. If 0, ’std::time(NULL)’ is used. Default value 0.
--test_file (-T) [ unknown ]
Optional matrix to be encoded by trained model.
--training_file (-t) [ unknown ]
Matrix of training data (X).
--verbose (-v) [ bool ]
Display informational messages and the full list of parameters and timers at the end of execution.
--version (-V) [ bool ]
Display the version of mlpack.
OPTIONAL OUTPUT OPTIONS
--codes_file (-c) [ unknown ]
Matrix to save the output sparse codes of the test matrix ( --test_file ) to.
--dictionary_file (-d) [ unknown ]
Matrix to save the output dictionary to.
--output_model_file (-M) [ unknown ]
File to save trained sparse coding model to.
ADDITIONAL INFORMATION
For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.