Code in PyTorch.
In order to use SAM:
- Install the package requirements with
pip install -r requirements.txt
. For PyTorch visit: http://pytorch.org - Install the package with the command:
python setup.py develop --user
- Execute the SAM by including the desired options:
import pandas as pd
from sam import SAM
sam = SAM()
data = pd.read_csv("test/G5_v1_numdata.tab", sep="\t")
output = sam.predict(data, nruns=12) # Recommended if high computational capability available, else nruns=1
We highly recommand to use GPUs if possible. Here is an example for 2 GPUs:
import pandas as pd
from sam import SAM
sam = SAM()
data = pd.read_csv("test/G5_v1_numdata.tab", sep="\t")
output = sam.predict(data, nruns=12, gpus=2, njobs=4) # As the model is small, we recommand using 2 jobs on each GPU
In order to download the datasets used in the paper as well as the generators, download the submodule "datasets" (458MB):
git submodule update --init
The acyclic graphs for the mechanisms Linear, GP Add, GP Mix, Sigmoid Add and Sigmoid Mix were generated using the software provided at : https://github.com/bquast/ANM/tree/master/codeANM