This is the official repository with the python implementation for the paper "Differentiable Multi-Target Causal Bayesian Experimental Design", ICML (2023).
The repository contains different acquisition strategies for optimal targeted interventions to learn causal models, including the proposed approach DiffCBED (which acquires both intervention batch of (multi-)target and values).
In order to run this repository on your machine, it is recommended to follow the below steps.
- Clone the repository
git clone --recurse-submodules https://github.com/yannadani/DiffCBED.git
cd diffcbed
- Install the relevant packages in an environment, through Anaconda. Anaconda is preferable as R packages can be installed easily without much effort. To do so, please do the following:
conda env create -f environment.yml
conda activate diffcbed
- Install the requirements by running the following commands:
pip install -r requirements.txt
Rscript models/dag_bootstrap_lib/install.r
- In order to run the DiffCBED policy (multi-target state) for 20 nodes with batch size of 2, run the following command:
python experimental_design.py --data_seed <data_seed> --model dag_bootstrap --num_nodes 20 --batch_size 2 --num_starting_samples 60 --strategy policyoptnmc --group_interventions --num_samples 25 --exp_edges .5 --num_targets -1 --old_er_logic
For constrained multi-target, replace --num_targets
flag with the desired number of targets (< d).
- For running other acquisition strategies like SSGb, run:
python experimental_design.py --data_seed <data_seed> --model dag_bootstrap --num_nodes 20 --batch_size 2 --num_starting_samples 60 --strategy ss_finite --group_interventions --num_samples 25 --exp_edges .5 --num_targets -1 --old_er_logic --intervention_value 5
- For running random strategy, run:
python experimental_design.py --data_seed <data_seed> --model dag_bootstrap --num_nodes 20 --batch_size 2 --num_starting_samples 60 --strategy random --group_interventions --num_samples 25 --exp_edges .5 --num_targets -1 --old_er_logic --value_strategy random
Other parameters can be changed to desired values (for e.g. different number of variables with the flag --num_nodes
). python experimental_design.py --help
gives more details.
- Details for reproducing the results in the paper are given in the branch full.
This code is official implementation of the following paper:
Yashas Annadani, Panagiotis Tigas, Desi R. Ivanova, Andrew Jesson, Yarin Gal, Adam Foster, Stefan Bauer. Differentiable Multi-Target Causal Bayesian Experimental Design. In International Conference on Machine Learning (ICML), 2023. PDF