Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMAP inconsistent results #79

Open
mroavi opened this issue Sep 24, 2023 · 1 comment
Open

MMAP inconsistent results #79

mroavi opened this issue Sep 24, 2023 · 1 comment

Comments

@mroavi
Copy link
Collaborator

mroavi commented Sep 24, 2023

The UAI 2014 Inference competition does not seem to provide reference solutions for the MMAP task.
Therefore, we are validating our results with those produced by the Merlin solver, which can be found here: https://github.com/radum2275/merlin.

The solutions produced by our tool and those generated by Merlin are inconsistent for several problems. It would be valuable to determine the reason for this discrepancy.

MWE:

using Revise, BenchmarkTools, Test, Artifacts
using TensorInference

import Pkg;
Pkg.ensure_artifact_installed("uai2014", "Artifacts.toml");

problem_sets = dataset_from_artifact("uai2014")["MMAP"]
problems = [
  ("Segmentation", 12, TreeSA(ntrials=1, niters=2, βs=1:0.1:40)),
  ("Segmentation", 13, TreeSA(ntrials=1, niters=2, βs=1:0.1:40)), # fails!
  #("Segmentation", 14, TreeSA(ntrials=1, niters=2, βs=1:0.1:40))  # fails!
]
for (problem_set_name, id, optimizer) in problems
  problem = problem_sets[problem_set_name][id]
  model = MMAPModel(
    read_model(problem); optimizer,
    evidence=read_evidence(problem),
    queryvars=read_queryvars(problem)
  )
  _, solution = most_probable_config(model)
  test_result = @test solution == read_solution(problem)
  println(test_result)
end
@mroavi
Copy link
Collaborator Author

mroavi commented Sep 24, 2023

One possible explanation for the inconsistency between our results and Merlin's could be the algorithms used. While our method produces exact results, Merlin supports the WMB, JGLP, IJGP, and GIBBS algorithms, all of which are approximate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant