poep

parent 07a43c84
......@@ -84,7 +84,7 @@ idx_t reinitialize_unused(const binary_matrix& E, const binary_matrix& H, binary
}
if (get_verbosity() >= 1) {
std::cout << "Removing " << (K-nused) << " unused atoms." << std::endl;
std::cout << "Replacing " << (K-nused) << " unused atoms." << std::endl;
}
binary_matrix Dp,Ap;
......@@ -199,6 +199,7 @@ idx_t learn_model_traditional(binary_matrix& X,
hdE = dist(E,Eprev);
hdD = dist(D,Dprev);
hdA = dist(A,Aprev);
reinitialize_unused(E,H,D,A);
} while (hdE > 0);
Eprev.destroy();
Aprev.destroy();
......
......@@ -508,10 +508,8 @@ void initialize_dictionary_samples(const binary_matrix& E,
if (Er.weight() == 0) continue;
A.set(k,r);
D.set_row(k,Er);
std::cout << '.';
k++;
}
std::cout << std::endl;
Er.destroy();
}
......
......@@ -13,6 +13,7 @@
#include "bmf_util.h"
#include "bmf_config.h"
#include "binimage.h"
#include "preview.h"
int mi_algo = 0; // -1 is initialization by file
int es_algo = 2; // default now is BMP
......@@ -265,6 +266,7 @@ int main(int argc, char **argv) {
//
// learn model
//
set_prefix("./");
idx_t L = learn_model_outer(X,H,E,D,A);
//
// write output
......
......@@ -4,7 +4,7 @@
static char prefix[1024];
void set_prefix(const char* p) {
strncpy(prefix,p,1023);
}
idx_t preview_none( const binary_matrix& X,
......@@ -29,4 +29,4 @@ idx_t preview_mosaic( const binary_matrix& X,
snprintf(tmpfname,127,"%s%04lu_%04lu_iter.pbm",prefix,outer_iter,inner_iter);
render_mosaic(D,tmpfname);
return 0;
}
\ No newline at end of file
}
......@@ -2,5 +2,5 @@
make -C code -j 4
outdir="results/vatican-mob"
mkdir -p ${outdir}
time code/bmf_learn_tool -i 1 -l 4 -k 10 -m 1 $* data/vatican/word_patches_stacked.pbm | tee ${ouitdir}.log
time code/bmf_learn_tool -i 1 -l 4 -k 20 -m 1 $* data/vatican/word_patches_stack.pbm | tee ${ouitdir}.log
mv *pbm ${outdir}
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