Comments (5)
yes. you can fix one parameter as seed and use another one as counter.
eg:
for(size_t i=0; i<100; i++) wyhash64(seed,i);
more:
for(size_t i=0; i<100; i++) for(size_t j=0; j<100; j++) wyhash64(i,j);
more:
for(size_t i=0; i<100; i++) for(size_t j=0; j<100; j++) wyhash64(seed, (i<<32)|j);
This algorithm can bee ported to GPU and cuda and serves as a parallel PRNG.
global void dropout(float *inp float out, uint64_t seed){
uint64_t id=blockIdx.xblockDim.x+threadIdx.x;
if(wyhash64(seed,id)&1) out[id]=inp[id];
else out[id]=0;
}
from wyhash.
Excellent, thank you. I actually need 4 independent streams so I wrote up a quick test harness to write them out interleaved and passed them to BigCrush and PractRand. I used these four values as seeds:
seed[0]: 0x78a236743da49cb
seed[1]: 0xddfac0f2bb9a0fc7
seed[2]: 0x57d60387d2570f66
seed[3]: 0x404ce50a76d36e08
And they passed all the BigCrush tests and 4TB and counting of PractRand.
from wyhash.
Last question: is wyhash64 reversible? Thus collision free?
from wyhash.
no, it is not reversible nor collision free. However, as a 64 bit PRNG, the space is so large, you can safely use it as BigCrush and Practrand are PRNG standard. More words are: collision is true random but collision free is not true random... Imagine I have a dice to bet with you. You observed 5 rolls: 1,2,3,4,5. If you know the dice is collision free, you can bet on 6 with all your money. But if it is not collision free, it is still fair.
from wyhash.
Ok that makes sense, as long as it's deterministic that's my important criteria =D
from wyhash.
Related Issues (20)
- v4 has even more bad seeds HOT 5
- Benchmark not measuring what you expect
- How do you use practrand? HOT 2
- License issue
- New release for wy_hash_final4?
- WyRand fails 64-bit 1-dimensional collision tests HOT 14
- Streaming hash HOT 1
- `make_secret` but for strings or other data
- Link to absl's wyhash implement seems to be changed. HOT 1
- WyRand64 (bit reversed) fails PractRand at 32TB HOT 3
- Question about wymum HOT 1
- Full round for every multiple 48-bytes, including last one HOT 1
- Secret seeds and primes HOT 4
- sprp and is_prime should be static inline? HOT 1
- c-string optimized version?
- wy2u0k returns [1, k] instead of [0, k) when WYHASH_CONDOM=2
- wyhash election started HOT 1
- 是否可能给函数更多的熵 HOT 2
- Is wy2u01 mistakenly not making use of all 53 bits?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wyhash.