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

如何实现结果可重复性? #46

Closed
liujian123223 opened this issue Dec 3, 2024 · 2 comments
Closed

如何实现结果可重复性? #46

liujian123223 opened this issue Dec 3, 2024 · 2 comments
Labels

Comments

@liujian123223
Copy link

你好,感谢你提供这么优秀的工作,我在使用代码的过程中。发现就算我固定随机数种子,但我使用SAITS运行的结果仍然会变化,你能告诉我如何才能让结果可以复现吗?谢谢
我使用了如下方法固定随机数种子,但他们依然无效。

设置随机种子,确保结果可复现

seed = 2024

设置Python的随机种子

random.seed(seed)

设置NumPy的随机种子

np.random.seed(seed)

设置PyTorch的随机种子

torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed) # 如果使用GPU,确保所有的CUDA设备都使用相同的种子

如果你使用了CuDNN(例如在NVIDIA GPU上运行),则需要禁用其自动调节以确保结果可复现

torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
set_random_seed(2024)

@WenjieDu
Copy link
Owner

WenjieDu commented Dec 3, 2024

Hi there,

Thank you so much for your attention to SAITS! If you find SAITS is helpful to your work, please star⭐️ this repository. Your star is your recognition, which can let others notice SAITS. It matters and is definitely a kind of contribution.

I have received your message and will respond ASAP. Thank you again for your patience! 😃

Best,
Wenjie

Copy link

This issue had no activity for 14 days. It will be closed in 1 week unless there is some new activity. Is this issue already resolved?

@github-actions github-actions bot added the stale label Dec 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants