question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sparse matrix support

See original GitHub issue

Is there any way to use autodiff on sparse scipy matrices? The docs say np.dot isn’t supported (and attempting it throws a ValueError: setting an array element with a sequence.). I can get the dot product with h.dot(W1), but autograd doesn’t work that way according to #8.

Is there any known workaround for dealing with sparse matrices, or anything planned?

Thanks for the great library!

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:7
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
namednilcommented, Oct 3, 2017

Did somebody start working on that? Sparse matrix support would make this really cool project even cooler as this would make it suitable for a variety of new tasks, especially for natural language processing.

4reactions
mattjjcommented, Dec 8, 2015

For proper support, we’d probably have to wrap the functions in scipy.sparse, analogous to the way we wrap scipy.linalg (and numpy everything else, check out autograd/scipy/ for examples). We may also need to introduce a new Node type to wrap sparse matrix instances. I don’t think sparse support is on any of our task lists right now, so this issue might remain open for a while.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sparse matrix - Wikipedia
In numerical analysis and scientific computing, a sparse matrix or sparse array is a matrix in which most of the elements are zero....
Read more >
Sparse matrices (scipy.sparse) — SciPy v1.9.3 Manual
This class provides a base class for all sparse matrices. ... The lil_matrix class supports basic slicing and fancy indexing with a similar...
Read more >
A Gentle Introduction to Sparse Matrices for Machine Learning
In this tutorial, you will discover sparse matrices, the issues they present, ... Need help with Linear Algebra for Machine Learning?
Read more >
Sparse Matrices - MATLAB & Simulink
Sparse matrices provide efficient storage of double or logical data that has a large percentage of zeros. While full (or dense) matrices store...
Read more >
RcppArmadillo: Sparse Matrix Support
There are 31 types of sparse matrices in the Matrix package that can be used directly. But for now, only. 12 of them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found