Code for "Lee, J. Y., Mehta, S. V., Wick, M., Tristan, J. B., & Carbonell, J. (2019, July). Gradient-based inference for networks with output constraints. In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 33, pp. 4147-4154)."
Python 3.6, PyTorch 0.4.1, AllenNLP v0.4.1
Conda can be used to set up a virtual environment with Python 3.6 in which you can sandbox dependencies required for our implementation:
-
Create a Conda environment with Python 3.6
conda create -n gbi python=3.6
-
Activate the Conda environment. (You will need to activate the Conda environment in each terminal in which you want to run our implementation).
source activate gbi
-
Visit http://pytorch.org/ and install the PyTorch 0.4.1 package for your system.
-
Clone our repo:
git clone git@github.com:sanketvmehta/gradient-based-inference.git
-
Clone
allennlp
with git submodulegit submodule update --init
-
Checkout
allennlp
tov0.4.1
git checkout 31f4f60
-
Change your directory to
allennlp
submodule present under the parent repo directory:cd gradient-based-inference/allennlp
-
Install the necessary requirement by running
INSTALL_TEST_REQUIREMENTS=true scripts/install_requirements.sh
-
Once the requirements have been installed, run:
pip install --editable .
-
Test AllenNLP installation by running:
./scripts/verify.py
That's it! You're now ready to reproduce our results.
If you use our code in your research, please cite: Gradient-based inference for networks with output constraints.
@inproceedings{lee2019gradient,
title={Gradient-based inference for networks with output constraints},
author={Lee, Jay Yoon and Mehta, Sanket Vaibhav and Wick, Michael and Tristan, Jean-Baptiste and Carbonell, Jaime},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={33},
pages={4147--4154},
year={2019}
}