can anybody help me understand why the output of the following code snippet
is different depending on 32bit or 64bit architecture::
x = np.empty((10 ** 6,), dtype=np.float64)
x.fill(1e-9)
hash(x.mean())
on 64bit I get: 2475364768
on 32bit I get: -1839780448
I expected that given you set an explicit dtype the result would be equal
on whatever architecture.
Even worse when I do the following::
np.sum(x)
I too get different results but when I do::
sum(x)
I get equal results... could it be that the temporary variables that numpy
uses in this routines are platform dependent or am I missing something
here.
thanks,
Peter
2013/8/24 Peter Prettenhofer <peter.prettenho...@gmail.com>
> Josef,
>
> thanks for double checking - I indeed had an error in my scripts - now I
> too get the same results for 32bit and 64bit.
>
> sorry for the false alarm.
>
> best,
> Peter
>
>
> 2013/8/24 <josef.p...@gmail.com>
>
>
>>
>>
>> On Sat, Aug 24, 2013 at 1:41 PM, Peter Prettenhofer <
>> peter.prettenho...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> while investigating some 64bit vs. 32bit differences in the GBRT code I
>>> stumpled upon this ticket [1].
>>> Even though its quite old, I can confirm that it holds on my virtual
>>> machines (np 1.7.1).
>>> Basically, np.random.RandomState(seed) gives different results on 64bit
>>> and 32bit architectures - this might cause different results on different
>>> architectures for a number of algorithms incl. stochastic gradient
>>> boosting, random forest, SGD
>>>
>>
>> Are you sure this is not a pickle issue?
>>
>> using seed=123 without pickling, I get the same numbers on Windows32
>> oldest versions that I have and Windows64 newest versions.
>>
>> Also, IIRC, numpy.random has unit tests that check that the random
>> numbers that are generated are platform independent, and the same across
>> versions.
>> (there was a mess, when Enthought once changed the random number
>> generator for the normal distribution, that triggered the addition of those
>> unit tests.)
>>
>> Josef
>>
>>
>>>
>>> best,
>>> Peter
>>>
>>> [1] http://mail.scipy.org/pipermail/numpy-tickets/2007-March/000810.html
>>>
>>> --
>>> Peter Prettenhofer
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Introducing Performance Central, a new site from SourceForge and
>>> AppDynamics. Performance Central is your source for news, insights,
>>> analysis and resources for efficient Application Performance Management.
>>> Visit us today!
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Scikit-learn-general mailing list
>>> Scikit-learn-general@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Introducing Performance Central, a new site from SourceForge and
>> AppDynamics. Performance Central is your source for news, insights,
>> analysis and resources for efficient Application Performance Management.
>> Visit us today!
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Scikit-learn-general mailing list
>> Scikit-learn-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>>
>
>
> --
> Peter Prettenhofer
>
--
Peter Prettenhofer
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general