About to add a new coefs. update method

parent a2aea448
......@@ -38,16 +38,20 @@ const char* mi_algorithm_names[] = {
0
};
es_algorithm_t es_algorithm_catalog[] = {coefficients_update_omp,
es_algorithm_t es_algorithm_catalog[] = {
coefficients_update_omp,
coefficients_update_basic,
coefficients_update_bmp,
coefficients_update_bmp_omp,
coefficients_update_lh,
0};
const char* es_algorithm_names[] = {"Basic coefficients update (OpenMP)",
const char* es_algorithm_names[] = {
"Basic coefficients update (OpenMP)",
"Basic coefficients update",
"BMP coefficients update",
"BMP coefficients update (OpenMP)",
"Least Hamming coefficients update",
0
};
......@@ -82,8 +86,8 @@ const char* lm_algorithm_names[] = {"Model learning by traditional alternate des
void learn_model_setup(int mi_algo, int es_algo, int du_algo, int lm_algo, int lmi_algo) {
if (mi_algo > 7) { std::cerr << "Invalid model initialization algorithm (0-" << 5 << ')' << std::endl; exit(-1); }
if (es_algo > 2) { std::cerr << "Invalid coefficients update algorithm (0-" << 2 << ')' << std::endl; exit(-1); }
if (mi_algo > 7) { std::cerr << "Invalid model initialization algorithm (0-" << 7 << ')' << std::endl; exit(-1); }
if (es_algo > 4) { std::cerr << "Invalid coefficients update algorithm (0-" << 4 << ')' << std::endl; exit(-1); }
if (du_algo > 3) { std::cerr << "Invalid dictionary update algorithm (0-" << 3 << ')' << std::endl; exit(-1); }
if (lm_algo > 6) { std::cerr << "Invalid model learning algorithm (0-" << 6 << ')' << std::endl; exit(-1); }
if (lmi_algo > 3) { std::cerr << "Invalid inner model learning algorithm (0-" << 3 << ')' << std::endl; exit(-1); }
......
......@@ -721,5 +721,29 @@ idx_t coefficients_update_missing_data_omp(binary_matrix& E,
}
/**
* Given a current error E, dictionary D and coefficients A, update E and A.
* This algorithm seeks to minimize the Least Hamming Error (LH)
* by repeatedly adding a pair (d_k,a_k) each time to the approximation so
* that the error is minimal w.r.t all other possible atoms d_k' != d_k.
* (note that, given an atom d_k, the choice of a_k is deterministic, so there
* are only k choices at each iteration).
*
* E = AD is an n x m matrix
* D is a p x m matrix, where each row is an atom of dimension m
* A is a n x p matrix, where each row contains the coefficients for representing the corresponding row of X=AD+E
* max_a_weight is the maximum allowed number of ones in any row of A
* max_e_weight is the maximum allowed number of ones in any row of E
*/
idx_t coefficients_update_lh(binary_matrix& E,
const binary_matrix& H,
const binary_matrix& D,
binary_matrix& A,
const idx_t max_a_weight,
const idx_t max_e_weight) {
return 0;
}
//==========================================================================
......@@ -62,4 +62,25 @@ idx_t coefficients_update_omp(binary_matrix& E,
const idx_t max_e_weight);
/**
* Given a current error E, dictionary D and coefficients A, update E and A.
* This algorithm seeks to minimize the Least Hamming Error (LH)
* by repeatedly adding a pair (d_k,a_k) each time to the approximation so
* that the error is minimal w.r.t all other possible atoms d_k' != d_k.
* (note that, given an atom d_k, the choice of a_k is deterministic, so there
* are only k choices at each iteration).
*
* E = AD is an n x m matrix
* D is a p x m matrix, where each row is an atom of dimension m
* A is a n x p matrix, where each row contains the coefficients for representing the corresponding row of X=AD+E
* max_a_weight is the maximum allowed number of ones in any row of A
* max_e_weight is the maximum allowed number of ones in any row of E
*/
idx_t coefficients_update_lh(binary_matrix& E,
const binary_matrix& H,
const binary_matrix& D,
binary_matrix& A,
const idx_t max_a_weight,
const idx_t max_e_weight);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment