Ben Chuanlong Du's Blog

It is never too late to learn.

Generating Random Numbers in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Comments

  1. rand::rngs::StdRng (currently, ChaCha block cipher with 12 rounds) is the default recommended RNG which is a trade off among speed, quality and security. While rand::rngs::StdRng is a good default choice as a secure PRNG, it might be too slow for statistical simulations where security is not of a critical concern. rand::rngs::SmallRng

Make Your Model Training Reproducible in PyTorch

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

The PyTorch doc Reproducibility has very detailed instructions on how to make your model training reproducible. Basically, you need the following code.

torch.manual_seed(args.seed)
np.random.seed(args.seed …