By "use the logs of the factors written above" do you mean taking the log of $\phi$ only, or the log of the entire message (equations 2 and 4)?
We mean implementing the message update as written, but working with log{m} instead of m, since it will be more stable numerically.
Thus, if:
m_{ij}(x_j)= max_{x_i} \phi(x_i,x_j) \prod_{k\in N(i)\neq j} m_{ki}(x_i)
You can equivalently write:
log(m_{ij}(x_j))= max_{x_i} log(\phi(x_i,x_j)) + \sum{k\in N(i)\neq j} \log{m_{ki}(x_i)}
And do all updates in log space.
Does it apply to the normalization phase?
its a bit problematic since log{m} can be negative and then the sum of messages calculate for normalizing can be negative
which would change the sign of the messages which would probably affect the node's belief.
Thanks!
You can implement multiplicatively (w.o logs) if you want, but since it's just a change of variables it shouldn't affect anything beyond numerical stability.
When working with logs, the message updates etc are additive, so zero values shouldn't be a problem.
Hi,
Maybe i misunderstood something about the log. when I do log(phi(x_i,x_j)), in most of the cases i get negative values - which is wrong since the message have to be positive, right? otherwise we might get negative values for the pixels.
The only times where we don't get negative values is when the difference between the pixel values is really small.
Does that make sense? how?
The messages don't have to be positive. They represent "weights" each pixel value has, not the actual pixel values.