tim-learn / SHOT

code released for our ICML 2020 paper "Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation"
MIT License
429 stars 78 forks source link

reduce random factors for reproducibility #10

Closed wengzejia1 closed 3 years ago

wengzejia1 commented 3 years ago

Hello, your work is really excellent. I'm very interested in your work ! So I ran your code and reproduced most of the experiment results.

In the process of reproducing the experiments, I found that I would get different scores by running the same script many times. So I believe we should add more restrictions in the code to reduce randomness and make the recurring results more certain. In this pull request, I add some restrictions to the digit code, including “torch.backends.cudnn.deterministic = True” and "torch.backends.cudnn.benchmark = False". I think such restrictions are necessary in your experiments.

The code in the object folder also has the same situation. If you agree with my thought, you can modify the object code, too.