Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Comments¶
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
Use of Mock Values in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Mocking¶
https://crates.io/crates/mailtutan
turmoil Turmoil is a framework for testing distributed systems. It provides deterministic execution by running multiple concurrent hosts within a single thread. It introduces "hardship" into the system via changes in the simulated network. The network can be controlled manually or with a seeded rng.
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 …
Hands on the Python module random
Understand System.identityHashCode in Java
Tips and Traps¶
- You cannot get the address of an object in Java (without hacking).
System.identityHashCode(obj)
is the next best thing you can have. This trick (combined with the timestamp) is used to generate default seed for random number generators in Java.