[Numpy-discussion] ufunc for sum of squared difference

Jerome Kieffer Jerome.Kieffer at esrf.fr
Wed Nov 16 03:29:24 EST 2016

On Mon, 14 Nov 2016 22:38:25 +0200
eat <e.antero.tammi at gmail.com> wrote:

> but it's not so obvious what's happening "under the hoods". Consider this
> (with an old Win7 machine):
> Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64
> bit (AMD64)]
> np.__version__
> '1.11.1'

What matters is the "blas" library used under the hood, hence the
options passed to numpy at compile time. I notices 20x differences
depending on the blas version.

But more importantly:
* results are the same (at the limit of the numerical precision)
* dot() was always faster than sum(square()), varying from a bit to a lot.

I agree this may change in future version of numpy.

Jérôme Kieffer

More information about the NumPy-Discussion mailing list