Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't reproduce MCSL main results #138

Open
MateuszOlko opened this issue Nov 21, 2023 · 1 comment
Open

Can't reproduce MCSL main results #138

MateuszOlko opened this issue Nov 21, 2023 · 1 comment
Assignees

Comments

@MateuszOlko
Copy link

MateuszOlko commented Nov 21, 2023

Hi, I tried reproducing results from the MCSL paper https://arxiv.org/pdf/1910.08527.pdf unsuccessfully.

I tried the code below. I aimed to use the parameters described in the paper and in the appendix.
I also tried variants with minor tweaks to this one.

from castle.algorithms import MCSL
from castle.common import GraphDAG
from castle.datasets import DAG, IIDSimulation
from castle.metrics import MetricsDAG

weighted_random_dag = DAG.erdos_renyi(n_nodes=10, n_edges=10, weight_range=(0.5, 2.0), seed=123)
dataset = IIDSimulation(W=weighted_random_dag, n=3000, method='nonlinear', sem_type='gp')
true_dag, X = dataset.B, dataset.X

# mcsl learn
mc = MCSL(model_type='nn',
          iter_step=1000,
          rho_thresh=1e20,
          init_rho=1e-3,
          rho_multiply=5,
          graph_thresh=0.5,
          l1_graph_penalty=2e-3,
          temperature=0.2,
          learning_rate=3e-2,
          h_thresh=0.25,
          h_tol=1e-8,
          max_iter=25,
          )
mc.learn(X)

# plot est_dag and true_dag
GraphDAG(mc.causal_matrix_weight, true_dag)

# calculate accuracy
met = MetricsDAG(mc.causal_matrix, true_dag)
print(met.metrics)

I always get results with SHD > 20. Have I chosen the parameters badly? Could you provide me with an example script that reproduces a result from the paper (any graph size and data generation method)?

@shaido987
Copy link
Collaborator

Hello,

For better support for this issue, I suggest you email the paper's corresponding author (email: zhushengyu@huawei.com).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants