Skip to content

DanCunnington/NSIL

Repository files navigation

NSIL: Neuro-Symbolic Learning of Answer Set Programs from Raw Data

This repository is associated with the paper "Neuro-Symbolic Learning of Answer Set Programs from Raw Data", published at IJCAI 2023. A recorded presentation is available. Please consider citing if it is useful in your work. The technical appendix forming our supplementary material is available here.

Intel x86 vs. Apple Silicon (Mac M1/M2)

If running on an intel machine, the recommended approach is using Docker. For Apple Silicon users, Docker can be used by adding the --platform linux/amd64 flag to the build and run commands, however, the performance hit is significant. It is recommended to install natively.

Docker installation

A docker container is provided for easy setup and installation so the only additional software required is a container runtime such as Docker Desktop, Podman, or minikube.

Setup

The following commands assume the docker command is available on your system. If using a different container run-time, please replace accordingly. From the root directory:

  1. docker build -t nsil:ijcai_2023 .
  2. docker run -d -p 8000:8000 -p 9990:9990 --name nsil_ijcai_2023 nsil:ijcai_2023
  3. Open http://localhost:8000 in your web browser to launch a markdown viewer containing detailed documentation that explains how to reproduce the experiment results.

Running experiments

Once the docker container is running:

  1. docker exec -it nsil_ijcai_2023 /bin/bash
  2. cd scripts
  3. Run experiments using the commands detailed in the documentation.

Stopping the container and removing files

exit
docker stop nsil_ijcai_2023
docker rm nsil_ijcai_2023
docker rmi nsil:ijcai_2023

Native Unix Installation

Pre-requisites

Installation

  1. Create python environment and install dependencies
virtualenv nsil_p3
source nsil_p3/bin/activate
pip install -r requirements.txt
  1. Download image data
chmod +x ./download_data.sh
./download_data.sh
  1. Create a setup script with the following contents:
BASE_PATH=/path/to/NSIL
export PYTHONPATH=$BASE_PATH
cd $BASE_PATH/examples/$1

and replace the value of BASE_PATH accordingly. Save this file to paper_experiments/ijcai_2023/scripts/setup.sh and ensure it has execute permissions. If you also want to run the NeurASP and FF-NSL baseline experiments, save a copy to paper_experiments/ijcai_2023/scripts/naive_baselines/setup.sh, again ensuring executable permissions.

  1. Move ILASP and FastLAS binaries to the root directory. We provide apple silicon and intel ubuntu linux binaries, copy accordingly.
mv LAS_binaries/ILASP_apple_silicon ILASP
mv LAS_binaries/FastLAS_apple_silicon FastLAS
  1. Set the python path to the root directory
export PYTHONPATH=/path/to/NSIL
  1. To view documentation:
cd paper_experiments/ijcai_2023/
chmod +x ./start_web_servers.sh
./start_web_servers.sh
  1. To run experiments:
cd paper_experiments/ijcai_2023/scripts
find . -type f -exec chmod +x {} \;
./run_arithmetic_repeats.sh -p 100 -s 0 -m 5 # For example - see documentation for more commands.

Citation

TBC

About

Code and technical appendix for the paper "Neuro-Symbolic Learning of Answer Set Programs from Raw Data".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published