CausalDiscoveryToolbox icon indicating copy to clipboard operation
CausalDiscoveryToolbox copied to clipboard

[BUG] SAM not working on AcyclicGraphGenerator data

Open edgarvardanyan opened this issue 5 years ago • 4 comments

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 image I run with cdt==0.5.22, torch==1.7.1 and on a GTX 1070 GPU.

edgarvardanyan avatar Dec 16 '20 21:12 edgarvardanyan

I am also receiving nones when trying to execute the same code.

bogatinovskijasmin avatar Dec 25 '20 19:12 bogatinovskijasmin

I am receiving the same error

calebclayreagor avatar Jan 04 '21 20:01 calebclayreagor

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

diviyank avatar Jan 05 '21 17:01 diviyank

Hi, the model has been updated/fixed, could you try again?

diviyank avatar Jan 13 '21 13:01 diviyank