[SciPy-User] Alternative for scipy.sparse.sparsetools for use from outside of scipy

Lev Konstantinovskiy lev.konst at gmail.com
Mon Oct 12 07:01:34 EDT 2015


Thanks for your reply. Raised a feature request for sparse in-place AXPY
https://github.com/scipy/scipy/issues/5348

The reason for using this routine is to save memory. Using
sparse.linalg.matmat would double the memory in
 y = y + chunk * o
to create a temporary chunk*o. But it seems the only way to go when
sparsetools becomes deprecated.

On Tue, Oct 6, 2015 at 8:28 PM, Pauli Virtanen <pav at iki.fi> wrote:
> Lev Konstantinovskiy <lev.konst <at> gmail.com> writes:
>> Getting deprecation warning for sparsetools. Is there an alternative to
>> switch to?
>>
>> The use is sparsetools.csc_matvecs in gensim
>> https://github.com/piskvorky/gensim/blob/9a1c2c954e2f72213023fc01f0e33306001e
>> 303f/gensim/models/lsimodel.py
>
> If I understand correctly, these are use cases that can be expressed
> in terms of usual sparse matrix operations,
>
> y = corpus * o
> y += corpus * chunk
>
> but you are using the internal sparsetools routines instead,
> because of performance reasons? Is the performance difference
> big in this case? Is the issue that you want in-place sparse AXPY,
> or is it due to dealing with small matrices and avoiding
> overheads?
>
> There's currently no sparse axpy available in Scipy.
> There probably should be though.
>
> Gensim is not a pure-Python module, so one relatively straightforward
> possibility is to just bundle a copy of the current sparsetools
> module (or just the one routine you need) with it. There's no SWIG
> nowadays involved, and it's independent of the rest of Scipy,
> so it's probably doable.
>
> --
> Pauli Virtanen
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list