SciPy SVD vs. Numpy SVD

后端 未结 2 1832
耶瑟儿~
耶瑟儿~ 2021-02-13 22:25

Both SciPy and Numpy have built in functions for singular value decomposition (SVD). The commands are basically scipy.linalg.svd and numpy.linalg.svd.

相关标签:
2条回答
  • 2021-02-13 22:47

    From the FAQ page, it says scipy.linalg submodule provides a more complete wrapper for the Fortran LAPACK library whereas numpy.linalg tries to be able to build independent of LAPACK.

    I did some benchmarks for the different implementation of the svd functions and found scipy.linalg.svd is faster than the numpy counterpart:

    However, jax wrapped numpy, aka jax.numpy.linalg.svd is even faster:

    Full notebook for the benchmarks are available here.

    0 讨论(0)
  • 2021-02-13 22:50

    Apart from the error checking, the actual work seems to be done within lapack both with numpy and scipy.

    Without having done any benchmarking, I guess the performance should be identical.

    0 讨论(0)
提交回复
热议问题