On Tue, Sep 4, 2012 at 12:26 AM, Sean Owen <[email protected]> wrote: > No, this always generates a newly-seeded MersenneTwisterRNG. However, > *if* you call RandomUtils.useTestSeed(), it will cause new instances > to have a fixed seed, and existing instances to be reset to this seed. > This is only called in the unit tests,
Ok i think this addresses my concern.. thanks. but lets RNGs be reset across > the JVM to a known state. (You can supply your own test seed to > useTestSeed()) too. This is desirable as is using a better RNG than > java.util.Random. > > I think this approach is even tidier than just recording the RNG seed > for later reuse. > > On Tue, Sep 4, 2012 at 7:54 AM, Dmitriy Lyubimov <[email protected]> wrote: >> Hello, >> >> i have a question regarding line 344 in SSVDSolver: >> >> >> Random rnd = RandomUtils.getRandom(); >> >> This random generator is used to obtain initial seed for random matrix >> of SSVD. It used to be just "new Random()" but at some point >> apparently was replaced with that util call. >> >> At least in unit test this seems to result in situation that unit test >> essentially gets a deterministic random gen. My guess is the intent is >> to keep unit tests from failing non-deterministically from time to >> time. >> >> but am i right assuming that outside of Mahout's unit test this >> actually will always be non-deterministic and I will be getting >> different seeds? Cause if i don't, i think that's a problem. >> >> Thanks. >> -Dmitriy
