Comments (3)
from nifty.
If I understand the issue correctly, I think the following accomplishes what you need:
import Nifty
// seed the global random number generator
let _ = randi(seed: 1234)
for _ in 0..<10
{
print(randi())
}
Each number printed to the screen is different, but I get the same set of 10 numbers every time the script is run. Any call to randi with a seed will seed the global generator (if threadSafe is not set) so it only needs to be passed in once. Does that resolve the issue?
In retrospect, it does seem a little weird to have the call to generate the random number also be the method for global seeding... Thoughts on what interface might be more intuitive?
from nifty.
Thanks! That does resolve the issue. A more explicit way to initialize the random number generator could be through another procedure, e.g. called "srand()" to initialize the RNG used by "rand()".
from nifty.
Related Issues (20)
- randn is now failing HOT 1
- Mean Vector Should Use Apple's Accelerate Framework when applicable HOT 3
- Error logging HOT 4
- pandas clone features HOT 1
- Demo and README do not include DataSeries/Frame functions HOT 1
- Shouldn't Tensor, Matrix and Vector share more code? HOT 7
- I found a nice testing framework for upgrading our unit tests :D HOT 7
- Tensor CSV representation HOT 5
- General Discussion HOT 6
- Use Float32, 64 and 80’s “ulp” Property for Comparison HOT 4
- Cap or Finish the Tensor Refactor for 1.0 HOT 2
- Enhance the Test Suite HOT 4
- Roadmap to 1.0 HOT 1
- Unable to build for Xcode HOT 1
- Allow specifying matrix layout HOT 4
- Matrix slices as views HOT 4
- Indirect Indexing in Matrices HOT 1
- Support sparse matrices HOT 1
- Homebrew dupes/science deprecated HOT 1
- Logo Design HOT 4
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 nifty.