dthuerck / mapmap_cpu

A high-performance general-purpose MRF MAP solver, heavily exploiting SIMD instructions.
BSD 3-Clause "New" or "Revised" License
102 stars 51 forks source link

why only set pairwise once? #25

Open s20163081161 opened 3 years ago

s20163081161 commented 3 years ago

/ cost types / using unary_t = UnaryTable<cost_t, simd_w>; using pairwise_t = PairwiseTruncatedLinear<cost_t, simd_w>; ....... / construct pairwise costs / pairwise = std::unique_ptr(new pairwise_t({1.0, 2.0})); .....

for(luint_t n = 0; n < num_nodes; ++n) mapmap.set_unary(n, unaries[n].get()); mapmap.set_pairwise(pairwise.get());

why only set pairwise once? what dose "new pairwise_t({1.0, 2.0})" mean ?

Look forward to your reply. Thanks!

dthuerck commented 2 years ago

Hi,

setting this only once means that all edges hare the same cost function. Parameters {1.0, 2.0} lead to the following cst function: c(l_1, l_2) = 1.0 * min(abs(l_1 - l_2), 2.0) as is seen in line135ff of the code.