CausalDiscoveryToolbox
CausalDiscoveryToolbox copied to clipboard
[BUG] SAM not working on AcyclicGraphGenerator data
While trying to run SAM on a data generated with AcyclicGraphGenerator, I get an error message and no result.
import cdt
data, graph = cdt.data.AcyclicGraphGenerator(causal_mechanism='linear', nodes=5, npoints=100).generate()
model = cdt.causality.graph.SAM(
train_epochs=3000,
test_epochs=300,
lambda1=10,
lambda2=0.001,
lr=0.001,
dlr=0.001,
gpus=1,
nruns=1,
njobs=2,
nh=20,
dnh=200,
dagpenalization_increase=0.01,
verbose=True
)
prediction = model.predict(data)
This yields
I run with cdt==0.5.22, torch==1.7.1 and on a GTX 1070 GPU.
I am also receiving nones when trying to execute the same code.
I am receiving the same error
Hello ! Sorry about this issue, it is linked to #66 and I will definitely fix and update the SAM code (the paper had a few modifications recently)
Best, Diviyan
Hi, the model has been updated/fixed, could you try again?