biomedia-mira/causal-gen

little confused about train_cf.py

Closed this issue · 2 comments

Hi, sir,thanks for the implementation! I'd think it is a great work!

I am little confused with specific counterfactual training steps. It seems that the network in "train_cf.py" only take single counterfactual parent into account during training. But there are actually multi counterfactual parents when infering(Like the case shown in Hugging Face).

So should I run the "train_cf.py" for every counterfactual parent (thickness->intensity->digit) one by one during training ?

Hi,

Thanks for your message.
So the counterfactual training setup we used involves interventions on a single parent at once, that is, for each batch element we randomly select which parent we would like to randomly intervene on. This intervention is then used to compute all the counterfactual parents depending on the associated causal graph.

It is of course possible to intervene on more than one parent at once, although we didn't observe any advantage in doing so in our experiments.

Best,
Fabio

I see. thank you sir