GithubHelp home page GithubHelp logo

Comments (3)

bashtage avatar bashtage commented on June 10, 2024

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.

jyzhang-bjtu avatar jyzhang-bjtu commented on June 10, 2024

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.

bashtage avatar bashtage commented on June 10, 2024

Going to close this.

from ng-numpy-randomstate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.