From: Eric M. <e.m...@po...> - 2002-07-23 20:02:13
|
On Tuesday 23 July 2002 20:54, Todd Miller wrote: > Eric Maryniak wrote: > >... > That should not, however, discourage you from writing a new and improve= d > random number package for numarray. Yes, thank you :-) > >... > >3. I wonder what the design philosophy is behind the decision > > to use 'mathematically suspect' seeding as default behavior. > > Using time for a seed is fairly common. Since it's an implementation > detail, I doubt anyone would object if you can suggest a better defaul= t > seed. Well, as said, a fixed seed, provided by the class implementation and therefore 'good', instead of a not-so-random 'random' seed. And imho it would be better not to (only) use the clock, but a /dev/rando= m kinda thing. Personally, I find the RNG setup much more appealing: there the default i= s: standard_generator =3D CreateGenerator(-1) where seed < 0 =3D=3D> Use the default initial seed value. seed =3D 0 =3D=3D> Set a "random" value for the seed from the syste= m clock. seed > 0 =3D=3D> Set seed directly (32 bits only). And indeed 'void Mixranf(int *s,u32 s48[2])' uses a built-in constant as initial seed value (actually, two). >... > > If you use default seed()'ing now and re-run your program/model > > later with identical parameters, you will get different output. > > When you care about this, you need to set the seed to something > deterministic. Naturally, but how do I know what a 'good' seed is (or indeed it's type, range, etc.)? I just would like, as e.g. RNG does, let the number generat= or take care of this... (or at least provide the option to) >... In the programs I've seen so far, including a lot of ours ahem, usually a program (simulation) is run multiple times with the same parameters and, in our case for neural nets, seeded each time with a clock generated seed and then the different simulations are compared and checked if they are similar or sensitive to chaotic influences. But I don't think this is the proper way to do this. My point is, I guess, that the sequence of these clock-generated seeds itself is not random, because (as for RandomArray) the generated numbers are clearly not random. Better, and reproducible, would be to start the first simulation with a supplied seed, get the seed and pickle after the first run and use the pickled seed for run 2 etc. or indeed have a kind of master script (as you suggest) that manages this. That way you would start with one seed only and are not re-seeding for each run. Because if the clock-seeds are not truly random, you will a much greater change of cycles in your overall sequence of numbers. Bye-bye, Eric --=20 Eric Maryniak <e.m...@po...> WWW homepage: http://pobox.com/~e.maryniak/ Mobile phone: +31 6 52047532, or (06) 520 475 32 in NL. VME ERROR 37022: Hierarchic name syntax invalid taking into account starting points defined by initial context. |