Comments (3)
mt19937 is slow and the jump operator is slow (fine for 4 streams, terrible for 1000s) -- you should use either xoroshiro128 or xorshirt1024.
I don't support CUDA. If you need CUDA you should use numba which has support for xoroshioro128 and jump. You can pregenerate the states on the CPU and then pass these to your CUDA threads. IIRC generating 10K states takes < 1S in numba.
In randomstate initializing 1000 states from xoroshiro128 takes 2.92ms.
From your example it isn't clear why you need independent streams. If you sample n*m numbers and then reshape to be (n,m) the resulting array should have independent rows and columns (statistically). The only real case for independent streams is if you are generating the random numbers in parallel, either on a cluster or say on a GPU.
from ng-numpy-randomstate.
The case is that I use this in the deep learning.
For example, I want generate an Epoch of size 1e5. The total data size, for example, is (1e5, 256), where 256 is the sample data length. The I want to shuffle the data set and iteratively learn on this data set. However, if I use the rand(1e5, 256), then I can not shuffle data and work on the same dataset.
Thanks a lot. I found xoroshiro128 is quick enough for my applications.
Best
from ng-numpy-randomstate.
Going to close this.
from ng-numpy-randomstate.
Related Issues (20)
- is this normal? HOT 5
- Python 3.6 wheels HOT 8
- help on RandomState functions show numpy examples HOT 3
- Can not be used on Debian 9 HOT 3
- Jump is too slow for larger jump steps! HOT 10
- optimized uniform small integers? HOT 4
- Add xoroshiro128+ HOT 1
- Lift "No Compatibility Guarantee" HOT 5
- Improve docstring for dtype
- Upload the latests releases to pypi? HOT 1
- faster ziggurat-like methods HOT 9
- did random_uintegers go away? HOT 11
- Segfault when seeding some prng's with float64 HOT 6
- Jump function for the MT19937 HOT 9
- A bug in MultithreadedRNG HOT 8
- Is there a generic randomstate class I can inherit from? HOT 3
- lognormal doc enhancement? HOT 2
- 1.13 fails to build HOT 13
- `advance` and `randint` HOT 6
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 ng-numpy-randomstate.