TensorBFS / TensorInference.jl

Probabilistic inference using contraction of tensor networks
https://tensorbfs.github.io/TensorInference.jl/
MIT License
18 stars 2 forks source link

Issue with `MMAPModel` and `most_probable_config` Function #93

Closed mroavi closed 2 months ago

mroavi commented 2 months ago

When running the MMAPModel function with the following code:

mmap = MMAPModel(model, evidence=Dict(1 => 1, 8 => 1), queryvars=[4, 7])

The output is:

MMAPModel{Int64, Array{Float64}}
variables: 1 (evidence → 1), 4, 7, 8 (evidence → 1)
query variables: [[2, 6, 5, 3]]
contraction time = 2^6.044, space = 2^3.0, read-write = 2^6.931

Note that the displayed query variables are incorrect.

Additionally, running:

most_probable_config(mmap)

returns:

(-0.6555208576754327, [1, 1, 1, 1])

However, the most probable configuration should only contain the query variables (two numbers in this case: vars 4 and 7).