Table of Contents
This repository contains the source code used for experiments in the following paper:
Cranefield, Stephen and Dhiman, Ashish. Identifying Norms from Observation Using MCMC Sampling, Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, International Joint Conferences on Artificial Intelligence, 118-124, 2021. https://doi.org/10.24963/ijcai.2021/17 (BibTeX)
The supplementary material for the paper can be found at Learning_Norms_with_MCMC_supp_material.pdf
The project covers the steps as given in the schematic below:
To clone and run this application, you'll need to follow the below-mentioned steps:
# Clone this repository
$ git clone https://github.com/ashish1610dhiman/learning_norms_with_mcmc_from_pcfg_IJCAI21
# Go into the repository
$ cd learning_norms_with_mcmc_from_pcfg_IJCAI21
# Ensure the repository is in the correct branch for the IJCAI experiments
$ git checkout non_compliance
# Install dependencies using pip
$ pip install -r requirements.txt
# Or install dependencies in a virtual environment, e.g. for conda:
$ conda create --name <env_name> --file requirements.txt
├── LICENSE
|
├── README.md <- The top-level README.
|
├── *_supp_material.pdf <- Supplemetary material for paper published in IJCAI-21.
|
├── data_nc/* <- Folder with dvc files for various experiments with p_nn > 0
|
├── data/* <- Folder with dvc files for various experiments with p_nn = 0
|
├── src/
│ ├── mcmc_norm_*/ <- Code files for grammar/Metropolis Hastings Algorithm/convergence
| | and preciscion-recall
│ └── *.py <- Small Helper files
│
├── scripts/ <- Scripts used for variouis instances of the process depicted in
| | schematic above.
│ └── nc_experiments.py <- Binding script used to run various parts of experiment
|
├── notebooks/ <- Jupyter notebooks. Naming convention is a number (for ordering),
│ the creator's initials, and a short `_` delimited description. The notebooks with tag 1.5 mark
| the files used for experiment shown in paper.
|
├── params_nc.yaml <- yaml file detailing parameters for experiments used
│
└── requirements.txt <- The requirements file for reproducing the analysis environment
The project uses dvc for tracking data. There are two data folders in the repository:
- data/: houses dvc files for data produced with older experiments
- data_nc/: dvc files for data produced with IJCAI submission experiments. The dvc files follow naming as per the iteration of experiment, or exp_nc{i}: for i ∈ {1,2,... , 5}
exp_nc5.dvc is the file corresponding to experiment presented in paper. Earlier experiments were for testing code changes.
Use the following commands to download the data corresponding to a dvc file:
# fetch the data
$ dvc fetch exp_nc5.dvc
# checkout the branch
$ dvc checkout
As outlined in the About The Project above, MCMC Norm learning pipleine involves the following steps:
- Initialise a Environment and task
- Generate obervations
- Generate MCMC chains
- Analyse MCMC chains
- Run Convergence tests on MCMC chains
- Get Top Norms from chains
The above steps are outlined in the binding script nc_experiments.py.
Jupyter notebook is then used as a wrapper over nc_experiments.py, to run different experiment iterations. The naming scheme of notebooks is mentioned above in Project Organsisation.
1.5_nc_exp5.ipynb is the notebook used to run experiment presented in paper
-
Stephen Cranefield
Department of Information Science, University of Otago (Professor)
Google Scholar -
Ashish Dhiman
Department of Aerospace Engineering, Indian Institute of Technology, Kharagpur (B-Tech, 2019)
Connect on LinkedIn