[Numpy-discussion] Suggestion: Port Theano RNG implementation to NumPy

Andreas Hilboll lists at hilboll.de
Tue Feb 18 11:54:14 EST 2014


On 18.02.2014 17:47, Sturla Molden wrote:
> Matthieu Brucher <matthieu.brucher at gmail.com> wrote:
>> Hi,
>>
>> The main issue with PRNG and MT is that you don't know how to
>> initialize all MT generators properly. A hash-based PRNG is much more
>> efficient in that regard (see Random123 for a more detailed
>> explanation).
>>> From what I heard, if MT is indeed chosen for RNG in numerical world,
>> in parallel world, it is not as obvious because of this pitfall.
>>
> 
> It is possible to solve this by using a set of independent MT generators,
> one per thread. Independence in this case means that the characteristic
> polynomials are relatively prime to each other:
> 
> http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/DC/dgene.pdf
> 
> Undortunately the DCMT code was LGPL, not BSD, I don't know if this has
> changed. 

I just checked.  The file dcmt0.6.1b.tgz, available from
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/DC/dc.html, contains
this license:

---8<-------

Copyright (C) 2001-2009 Makoto Matsumoto and Takuji Nishimura.
Copyright (C) 2009 Mutsuo Saito
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Cheers, Andreas.



More information about the NumPy-Discussion mailing list