dual layer loopy belief propagation