random-seed

What is the $RANDOM_SEED$ file generated by Visual Studio build of C# solution?

白昼怎懂夜的黑 提交于 2019-12-03 09:04:40
问题 We noticed that on a certain dev machine a Visual Studio (2015 update 3) debug build of a C# solution was generating a $RANDOM_SEED$ file alongside every built DLL. The content of the file is just a single number e.g. 1443972318 Deleting the file(s) then rebuilding resulted in the file being regenerated, with a different number. This behaviour was also observed when rebuilding a single project in the solution (one which has only the standard C# project refs/dependencies + System.Management).

Best way to add seed to Perlin noise?

青春壹個敷衍的年華 提交于 2019-12-03 05:02:54
问题 I'm trying to implement 2D Perlin noise generation in C++, and some implementations I found use no seed at all (here, here or here). Other implementations take a seed value to get different noise depending on the noise value. However I found example code where one added the seed value to the function parameters calculating the noise value for each octave (see PerlinNoise::Total() in the linked code). Another one uses a 3D seed function and uses the fixed seed value as the z value (couldn't

What is the scope of a random seed in Python?

…衆ロ難τιáo~ 提交于 2019-12-03 04:38:56
If I use the Python function random.seed(my_seed) in one class in my module, will this seed remain for all the other classes instantiated in this module? Yes, the seed is set for the (hidden) global Random() instance in the module. From the documentation : The functions supplied by this module are actually bound methods of a hidden instance of the random.Random class. You can instantiate your own instances of Random to get generators that don’t share state. Use separate Random() instances if you need to keep the seeds separate; you can pass in a new seed when you instantiate it: >>> from

Is seeding data with fixtures dangerous in Ruby on Rails

拟墨画扇 提交于 2019-12-03 03:27:23
I have fixtures with initial data that needs to reside in my database (countries, regions, carriers, etc.). I have a task rake db:seed that will seed a database. namespace :db do desc "Load seed fixtures (from db/fixtures) into the current environment's database." task :seed => :environment do require 'active_record/fixtures' Dir.glob(RAILS_ROOT + '/db/fixtures/yamls/*.yml').each do |file| Fixtures.create_fixtures('db/fixtures/yamls', File.basename(file, '.*')) end end end I am a bit worried because this task wipes my database clean and loads the initial data. The fact that this is even

What is meant by a seed in random number generation?

☆樱花仙子☆ 提交于 2019-12-02 15:05:08
问题 Though I have referred about the meaning of seed in google,I can't get the exact answer that I want.Can anybody explain with an example? 回答1: It's an initial value for a random number generator to base its sequence of random numbers on. If you seed two random number generators with the same value, they'll produce the same sequence of numbers. This is useful for testing purposes. In production, you typically seed a random number generator with a value that's hard to guess, like the millisecond

Difference between math.random() and math.randomseed() in Lua

半世苍凉 提交于 2019-12-02 11:26:24
问题 I am working on game using Corona SDK with Lua as Programming Language . While getting random number from table , I am confused to use which one of following ? math.random() math.randomseed() Will any one elaborate the exact difference between them ? So I can use the best one in my case. 回答1: If you need the same sequence when you call math.random() , then you must set math.randomseed(same number every time before calling) before calling math.random() . If you want a different sequence of

What is meant by a seed in random number generation?

夙愿已清 提交于 2019-12-02 08:20:30
Though I have referred about the meaning of seed in google,I can't get the exact answer that I want.Can anybody explain with an example? It's an initial value for a random number generator to base its sequence of random numbers on. If you seed two random number generators with the same value, they'll produce the same sequence of numbers. This is useful for testing purposes. In production, you typically seed a random number generator with a value that's hard to guess, like the millisecond value from your system clock. A seed is used to initialize a pseudorandom number generator. It is a

generate random number in c++

早过忘川 提交于 2019-12-02 00:41:06
I get a task to generate tens of thousands random number in c++. I've googled a lot about random number in c++ and look up the c++ reference, but I got confused now. As I know, random_device is a non-deterministic random number generator, but every time I re-run my program, the random number generated by random_device is the same. So how do I set a seed for random_device to make the random number is different when I restart my program? And I've read that "std::random_device could run out of entropy if you try to get a lot of numbers from it. That could cause it to block until you move the

Same seed, different OS, different random numbers in R

核能气质少年 提交于 2019-12-01 13:55:42
问题 I was experiencing inconsistent results between two machines and a linux server, until I realized that fixing the seed was having different effects. I am running different R versions in all of them, all above 3.3.0 . Here are the examples: Linux 1 > set.seed(10); rnorm(1) [1] -0.4463588 > version _ platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 3 minor 3.0 year 2016 month 05 day 03 svn rev 70573 language R version.string R version 3.3.0 (2016-05-03

How to seed the random number generator for scikit-learn?

陌路散爱 提交于 2019-12-01 11:33:16
I'm trying to write a unit test for some of my code that uses scikit-learn. However, my unit tests seem to be non-deterministic. AFAIK, the only places in my code where scikit-learn uses any randomness are in its LogisticRegression model and its train_test_split , so I have the following: RANDOM_SEED = 5 self.lr = LogisticRegression(random_state=RANDOM_SEED) X_train, X_test, y_train, test_labels = train_test_split(docs, labels, test_size=TEST_SET_PROPORTION, random_state=RANDOM_SEED) But this doesn't seem to work -- even when I pass a fixed docs and a fixed labels , the prediction