New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting RNG in StratifiedCrossValidationSplitting for thread safety #1424
Setting RNG in StratifiedCrossValidationSplitting for thread safety #1424
Conversation
Nice! We should update unit tests though if we touch this. See the libshogun examples where I wrote test examples which can be migrated. Sorry for all the requests and thanks again;) |
I updated my PR and shuffle(CRandom *) methods to several classes. I found out that the parameter-less shuffle() is not consumed somewhere else, so I encourage to remove it. Objections? |
agreed! What about the examples/test? Interested? :) |
Yes please keep the static one too. |
@sonney2k: Reverted my last commit, so your parameter-less (and non-thread-safe) methods are back. @karlnapf: I know good test coverage is important, but I currently can't do it. Have a brief look on the complete diff. I think unit-tests are not (strongly) required for the following reasons:
|
SGVectorTest.dot failed on travis? |
@tklein23 I agree it is safe to not add them. Though it would be very easy since the tests already exist as c++ examples, just have to be translated to unit tests. But I can do that also at some point. |
…dified StratifiedCrossValidationSplitting so that we can set own RNGs using member m_rng.
…ObjectArray for thread safe shuffling. (e.g. parallel cross validation)
…huffle(m_rng) for shuffling arrays.
I did a rebase & push --force to trigger travis. It's (almost) green now. |
It is possible to restart complete builds or jobs from the travis GUI. You have to sign in with your github account and I guess that permissions for the repository are also needed. |
@iglesias: Thanks for telling. Didn't know that. |
Setting RNG in StratifiedCrossValidationSplitting for thread safety
Using the same CRandom instance over multiple threads is not safe. Modified StratifiedCrossValidationSplitting so that we can set own RNGs using member m_rng. This patch works for me when using different instances of CStratifiedCrossValidationSplitting across multiple threads.
@karlnapf: I think there's need for discussion. Please have a look.