This is the implementation of our paper Supervised Full DAG Causal Discovery. If this is helpful for your research, please consider cite our paper.
The experiments are sketched in src/main.jl. To run it, you first instantiate the project invironment, then run
julia --project src/main.jl
Or you can use the pre-trained models. Pre-trained models can be found at:
You can also found them in the release page.
Load the pretrained models:
@load "/path/to/model.bson" model
Data can be generated by:
spec = DataSpec(d=10, k=1, gtype=gtype, noise=:Gaussian)
ds, test_ds = spec2ds(spec)
Apply the model on the data:
x, y = next_batch!(test_ds)
pred = model(x)
loss = myσxent(pred, y)
metric = sup_graph_metrics(cpu(σ.(pred)), cpu(y))
@show metrics
The script for running other method is src/baseline.py. You should install those methods (various python and R projects) before running the script.