[ICML 2025] Official Code of SYNC
Zhuo He, Shuang Li, Wenze Song, Jian Liang, Han Li, Kun Gai
- By taking a novel causal perspective towards EDG problem, we design a time-aware SCM that enables the refined modeling of both dynamic causal factors and causal mechanism drifts. After that, we propose Static-DYNamic Causal Representation Learning (SYNC), an approach for effectively learning time-aware causal representations, thereby mitigating spurious correlations.
- Theoretically, we show that SYNC can build the optimal causal predictor for each time domain, resulting in improved model generalization.
- Results on both synthetic and real-world datasets, along with extensive analytic experiments demonstrate the effectiveness of proposed approach.
The code is implemented with Python 3.8.18
and run on NVIDIA GeForce RTX 4090
. To try out this project, it is recommended to set up a virtual environment first.
# Step-by-step installation
conda create -n sync python=3.8.18
conda activate sync
# install torch, torchvision and torchaudio
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge
# this installs required packages
pip install -r requirements.txt
All datasets are available for download here.
# running for Circle dataset:
bash scripts/train_circle_sync.sh
# running for Sine dataset:
bash scripts/train_sine_sync.sh
# running for RMNIST dataset:
bash scripts/train_rmnist_sync.sh
# running for Portraits dataset:
bash scripts/train_portraits_sync.sh
# running for Caltran dataset:
bash scripts/train_caltran_sync.sh
# running for PowerSupply dataset:
bash scripts/train_power_sync.sh
# running for ONP dataset:
bash scripts/train_onp_sync.sh
This project is mainly based on the open-source project: DomainBed and LSSAE. We thank the authors for making the source code publicly available.