We introduce Approximate Neurosymbolic Inference (A-NeSI) a new framework for Probabilistic Neurosymbolic Learning that uses neural networks for scalable approximate inference. A-NeSI
- performs approximate inference in polynomial time without relaxing the semantics of probabilistic logics;
- is trained using synthetic data generated by the background knowledge;
- can generate symbolic explanations of predictions; and
- can guarantee the satisfaction of logical constraints at test time.
For more information, consult the papers listed below.
A-NeSI has the following requirements:
- Python - v3.9.15
- PyTorch - v1.12.1
- TorchVision - v0.13.1
- Weights&Biases - v0.13.2
Run the following:
-
Install the dependencies inside a new virtual environment:
bash setup_dependencies.sh
-
Activate the virtual environment:
conda activate NRM
-
Install the A-NeSI module: pip install -e .
The experiments are presented in the papers are available in the anesi/experiments directory. The experiments are organized with Weights&Biases. To reproduce the experiments from the paper, run
cd anesi/experiments
wandb sweep repeat/test_predict_only.yaml
wandb agent <sweep_id>
Note that you will need to update the entity and project parameters of wandb in the sweep files.
A-NeSI: A Scalable Approximate Method for Probabilistic Neurosymbolic Inference (Arxiv)
@misc{https://doi.org/10.48550/arxiv.2212.12393,
doi = {10.48550/ARXIV.2212.12393},
url = {https://arxiv.org/abs/2212.12393},
author = {van Krieken, Emile and Thanapalasingam, Thiviyan and Tomczak, Jakub M. and van Harmelen, Frank and Teije, Annette ten},
keywords = {Machine Learning (cs.LG), Artificial Intelligence (cs.AI), Logic in Computer Science (cs.LO), Machine Learning (stat.ML), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {A-NeSI: A Scalable Approximate Method for Probabilistic Neurosymbolic Inference},
publisher = {arXiv},
year = {2022},
copyright = {arXiv.org perpetual, non-exclusive license}
}