Skip to content

On the Hardness of Probabilistic Neurosymbolic Learning (ICML2024)

License

Notifications You must be signed in to change notification settings

jjcmoon/hardness-nesy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

On the Hardness of Probabilistic Neurosymbolic Learning

[paper]

Code to the reproduce the experiments of the paper "On the Hardness of Probabilistic Neurosymbolic Learning" (ICML 2024).

Tip

If you just want to use WeightME, take a look at Kompyle.

Installation

Install d4 and EvalMaxSAT, for exact compilation and MaxSat solving, respectively. Furthermore, make sure the following python libraries are installed.

pip install numpy torch pycmsgen problog pysdd tqdm matplotlib scienceplots

Data generation

The MCC benchmarks can be downloaded in dimacs format at:

Note that we only use the weighted model counting track (track2). The different benchmarks should be saved in the data folder. The Road-R benchmark is already included.

Note that Windows is not supported. The random weights of the MCC benchmarks are generated using

python scripts/reweight_instances.py

Usage

First, generate the d-DNNF circuits with d4. (This will take a while.)

python scripts/run_d4.py

Next, we can evaluate these circuits in d4 to get the exact gradients. (This will take a while. For the largest circuits, 256GB RAM is necessary.)

python scripts/nnf_to_grads.py

Finally, we can run one of the approximate methods.

python scripts/run_approx_solver.py

You can select the specific method and hyperparameters at the bottom of the file. (To run all methods and with multiple hyperparameters, its recommended to parallize this over multiple machines.)

Similarly, the training experiments can be run using

python scripts/run_training.py

Once all experiments have finished running, the figures and table of the paper can be generated using

python scripts/aggregate_results.py

Paper

@inproceedings{maene2024hardness,
  title={On the Hardness of Probabilistic Neurosymbolic Learning},
  author={Maene, Jaron and Derkinderen, Vincent and De Raedt, Luc},
  booktitle={Proceedings of the 41th International Conference on Machine Learning},
  year={2024}
}

About

On the Hardness of Probabilistic Neurosymbolic Learning (ICML2024)

Topics

Resources

License

Stars

Watchers

Forks

Languages