random-seed Questions

2

Solved

I am training a DL model in Pytorch, and want to train my model in a deterministic way. As written in this official guide, I set random seeds like this: np.random.seed(0) torch.manual_seed(0) torc...
Fleshings asked 11/3, 2019 at 8:17

1

Solved

I have a question about seeding in open AI gym and utilizing it in custom environments. Let's take the lunar lander environment for example, the default seeding function is: def seed(self, seed=No...
Faultfinder asked 9/10, 2019 at 13:3

4

Solved

I am writing a program compatible with both Python 2.7 and 3.5. Some parts of it rely on stochastic process. My unit tests use an arbitrary seed, which leads to the same results across executions a...
Thier asked 14/8, 2016 at 14:9

22

Solved

Is it possible to seed the random number generator (Math.random) in JavaScript?
Cornhusk asked 6/2, 2009 at 17:37

2

Solved

Is there a deterministic random number generator in <random> in C++? The point in question is that the below code on my Windows machine: #include<iostream> #include<random> int ma...
Blastocyst asked 1/9, 2023 at 15:24

1

Solved

How is it possible, that running the same Python program twice with the exact same seeds and static data input produces different results? Calling the below function in a Jupyter Notebook yields th...
Win asked 19/5, 2023 at 16:5

9

I am trying to generate N sets of independent random numbers. I have a simple code that shows the problem for 3 sets of 10 random numbers. I notice that even though I use the tf.set_random_seed to ...
Nescience asked 9/7, 2018 at 16:7

6

Solved

I'm trying to generate seeded random numbers with Swift 4.2+, with the Int.random() function, however there is no given implementation that allows for the random number generator to be seeded. As f...
Hypoxia asked 22/2, 2019 at 6:56

5

Solved

In excel below formula will generate random number from a normal distribution with mean 10 and variance 1. Is there a way to set a fix seed so that i get a fix set of random numbers all the time? I...
Parotic asked 16/10, 2015 at 1:27

3

Solved

I want to generate a random seed in a predictable way. I was hoping to do this seed = 12345 prng_0 = random.Random(seed) prng_1 = random.Random(prng_0.rand_int(0)) There, 0 is the lower bound, but...
Inaugurate asked 9/6, 2015 at 1:39

2

I often use numpy.random.seed() for reproducibility of results. I also find it helpful when books/tutorials use it (e.g., np.random.seed(42)), so that people can reproduce things more easily. The t...
Mordancy asked 12/2, 2022 at 16:19

6

Solved

The following imports NumPy and sets the seed. import numpy as np np.random.seed(42) However, I'm not interested in setting the seed but more in reading it. random.get_state() does not seem to c...
Paraglider asked 23/8, 2015 at 22:10

4

Solved

In a general tensorflow setup like model = construct_model() with tf.Session() as sess: train_model(sess) Where construct_model() contains the model definition including random initializa...
Weil asked 3/2, 2017 at 11:16

3

Solved

Does torch.manual_seed include the operation of torch.cuda.manual_seed_all? If yes, we can just use torch.manual_seed to set the seed. Otherwise we should call both functions.
Haft asked 18/5, 2021 at 6:51

3

I've created a very simple OpenAI gym (banana-gym) and wonder if / how I should implement env.seed(0). See https://github.com/openai/gym/issues/250#issuecomment-234126816 for example.
Syndetic asked 16/11, 2017 at 13:42

3

Solved

I am currently running R version 3.1.0 (on Ubuntu 12.04 LTS) and as both my R version and my operating system is getting rather old, I plan on updating both. However, I have a lot of simulations th...
Cordovan asked 9/11, 2017 at 10:26

2

Solved

I'm parallelizing simulations in R (using mclapply() from the parallel package) and wanted to track my progress with each function call. So I instead decided to use pbmclapply() from the pbmcapply ...

2

Solved

I'm looking to create a deterministic number generation function where the input number will always generate the same number, but no two numbers will end up generating the same result. E.g.: 1 -&gt...
Hornblende asked 10/5, 2022 at 14:19

4

Solved

I have a bash script that starts many client processes. These are AI game players that I'm using to test a game with many players, on the order of 400 connections. The problem I'm having is that t...
Symbolics asked 3/6, 2018 at 0:21

2

Solved

The recommended way by numpy to create random numbers is to create a np.random.Generator like this import numpy as np def foo(): # Some more complex logic here, this is the top level method that ...
Crelin asked 2/7, 2021 at 9:26

3

Regarding the seeding system when running machine learning algorithms with Scikit-Learn, there are three different things usually mentioned: random.seed np.random.seed random_state at SkLearn (cr...
Imperfect asked 10/10, 2018 at 18:4

3

Is it possible to reverse a pseudo random number generator? For example, take an array of generated numbers and get the original seed. If so, how would this be implemented?
Myotonia asked 4/11, 2014 at 19:32

4

I want to shuffle the lines of a file with a fixed seed so that I always get the same random order. The command I am using is as follows: sort -R file.txt | head -200 > file.sff What change c...
Snelling asked 6/5, 2011 at 16:47

3

Solved

I'm working on denoising dirty image document. I want to create a dataset wherein synthetic noise will be added to simulate real-world, messy artifacts. Simulated dirt may include coffee stains, fa...

1

Solved

While analyzing a code, I've stumbled upon the following snippet: msk = np.random.rand(len(df)) < 0.8 Variables "msk" and "df" are irrelevant for my question. After doing so...
Naquin asked 7/9, 2021 at 8:18

© 2022 - 2025 — McMap. All rights reserved.