12#ifndef MLPACK_METHODS_SPARSE_CODING_DATA_DEPENDENT_RANDOM_INITIALIZER_HPP
13#define MLPACK_METHODS_SPARSE_CODING_DATA_DEPENDENT_RANDOM_INITIALIZER_HPP
19namespace sparse_coding {
40 arma::mat& dictionary)
43 dictionary.set_size(data.n_rows, atoms);
46 for (
size_t i = 0; i < atoms; ++i)
54 dictionary.col(i) /= norm(dictionary.col(i), 2);
A data-dependent random dictionary initializer for SparseCoding.
static void Initialize(const arma::mat &data, const size_t atoms, arma::mat &dictionary)
Initialize the dictionary by adding together three random observations from the data,...
int RandInt(const int hiExclusive)
Generates a uniform random integer.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Miscellaneous math random-related routines.