ikarus icon indicating copy to clipboard operation
ikarus copied to clipboard

Sparse dot product

Open epaaso opened this issue 1 year ago • 1 comments

When using big datasets, calculation of the dot product with numpy requires assigning a lot of virtual memory to the dense connectivity matrix. Most computers won't be able to allocate that much RAM.

Luckily, scipy has a sparse matrix dot operation that is both much faster and requires much less RAM. It is a method the sparse matrix object.

Also, we don't have to check if the matrix is sparse because numpy has an inner method for dense matrices that is called in the same way.

epaaso avatar Jan 18 '24 13:01 epaaso

Hi! Thank you for the hint and your PR. I left a comment regarding the axis in the summation. Apart from that it looks good to me!

dohmjan avatar Feb 27 '24 07:02 dohmjan