Skip to content

MMAP queries with mmap_solve() and v0.3.3: Node not defined error #141

@mattShorvon

Description

@mattShorvon

Hi guys

Hope you're well! I have a slightly niche problem. I'm keen to test out the technique for solving MMAP queries described in "Solving MMAP exactly by probabilistic circuit transformations" (Choi et al. 2022). The code for the experiments, and the mmap_solve() function are found on the marginal-map branch (https://github.com/Tractables/ProbabilisticCircuits.jl/tree/marginal-map, now a few years old). I've been testing it out, with an old version of ProbabilisticCircuits installed (v0.3.3), and keep getting a 'Node not defined' error. Here is a toy example:

Training a pc with strudel then trying mmap_solve on it:

`using ProbabilisticCircuits
using DataFrames
using LogicCircuits
using DiscriminativeCircuits
using DataConvenience

include("<path to queries/marginal_map.jl>")

train_x, valid_x, test_x = twenty_datasets("nltcs")
pc = learn_circuit(train_x; maxiter=100)
println(pc) # its definitely of type StructSumNode!
query = BitSet([1,2,3])
mmap_solve(pc, query, num_iter=1)`

We get a node not defined error!
Loading a pre-trained psdd instead and trying that:

pc = zoo_psdd("little_4var.psdd") mmap_solve(pc, query, num_iter=1)

same problem

It seems to be complaining about the pc objects I'm inputting, the function says it admits a StructSumNode input, and I'm sure the pc learned by learn_circuit() is of that format. The pre-loaded one is a PlainSumNode object, but I saw a similar circuit being loaded and inputted in the experiment code. What am I doing wrong here? Sorry that these are questions about an old version of this repo, but any help would be really appreciated!

Kind regards

Matthew

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions