Skip to content

liqing-ustc/NSR

Repository files navigation

Neural-Symbolic Recursive Machine for Systematic Generalization

Prerequisites

  • Ubuntu 20.04
  • Python 3.6
  • NVIDIA TITAN Xp
  • PyTorch 1.7.0

Getting started

  1. Download the datasets
cd datasets
./download.sh
  1. Download the pre-trained ResNet-18 to the data/perception-pretrain/ folder:

  2. Download the DreamCoder and unzip it to the semantics/ folder.

  3. Create an environment and install all packages from requirements.txt:

conda create -y -n nsr python=3.6
source activate nsr
pip install -r requirements.txt
  1. Run experiments on :
python run_sweep.py sweeps/[DATASET].yaml

Usage

The code uses Weights & Biases for experiment tracking. In the sweeps directory, we provide sweep configurations for all experiments we have performed. The sweeps are officially meant for hyperparameter optimization, but we use them to run multiple configurations and seeds.

To reproduce our results, start a sweep for each of the YAML files in the sweeps directory.

For example,run the experiments on the SCAN dataset:

./run_sweep.py sweeps/scan.yaml --n_agent 3 --gpus=0,1,2

You can change the number of sweep agents and GPUs used, according to your computing resource.

More details on how to run W&B sweeps can be found at https://docs.wandb.com/sweeps/quickstart.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published