[Numpy-svn] [numpy/numpy] 08e8c1: MAINT: corrcoef, memory usage optimization

GitHub noreply at github.com
Mon Oct 5 16:39:06 EDT 2015


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 08e8c1415670b029c26ae8ce0585fb9ea0b11e63
      https://github.com/numpy/numpy/commit/08e8c1415670b029c26ae8ce0585fb9ea0b11e63
  Author: Ruediger Meier <ruediger.meier at ga-group.nl>
  Date:   2015-09-30 (Wed, 30 Sep 2015)

  Changed paths:
    M numpy/lib/function_base.py

  Log Message:
  -----------
  MAINT: corrcoef, memory usage optimization

We calculate sqrt on the small vector rather than on that huge
product matrix and we combine the "outer" product with element-wise
devision. So even though we have a slower loop over the rows now ... this
code snippet runs about 3 times faster than before.

However the speed improvement of the whole function is not really
significant because cov() takes 80-99% of the time (dependent on
blas/lapack implementation and number of CPU cores).

More important is that we will safe 1/3 memory. For example corrcoef()
for a [23k, m]  matrix needs 8GB now instead of 12GB.


  Commit: d5bde029dea303093ecd1f1190c5fb5a478fb414
      https://github.com/numpy/numpy/commit/d5bde029dea303093ecd1f1190c5fb5a478fb414
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2015-10-05 (Mon, 05 Oct 2015)

  Changed paths:
    M numpy/lib/function_base.py

  Log Message:
  -----------
  Merge pull request #6396 from rudimeier/opt-corrcoef

MAINT: corrcoef, memory usage optimization


Compare: https://github.com/numpy/numpy/compare/eef84446662b...d5bde029dea3


More information about the Numpy-svn mailing list