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

Codes based on the GCN Predictor in model zoo are not reproducible #212

Open
WMX567 opened this issue Mar 8, 2023 · 1 comment
Open

Comments

@WMX567
Copy link

WMX567 commented Mar 8, 2023

Hi,

I use the GCN Predictor in this repo

DGL version is 1.0.1
PyTorch version is 1.12.1

I set the random seeds in this way:

random.seed(seed)
np.random.seed(seed)

torch.manual_seed(seed+r)
torch.cuda.manual_seed_all(seed+r)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False

dgl.random.seed(seed+r)

Any idea about how to fix the reproducibility? Thanks!

@mufeili
Copy link
Contributor

mufeili commented Mar 8, 2023

DGL-LifeSci just employs a few operators in DGL and PyTorch. If some of these operators have inherent randomness that cannot be addressed by fixing the random seed, then you will still see some randomness in the results you obtain. One way to tackle the issue is to report the mean and std of the performance numbers over multiple random runs. If you are dealing with a small dataset, then running multiple runs will not be infeasible.

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

2 participants