Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized SVD #803

Merged
merged 2 commits into from
Jan 23, 2016
Merged

Randomized SVD #803

merged 2 commits into from
Jan 23, 2016

Conversation

hunse
Copy link
Collaborator

@hunse hunse commented Aug 5, 2015

Added a randomized SVD solver. This is pretty fast for larger matrices (on my system, it gets faster than cholesky for around 650 neurons, and can solve a system with 60000 eval points and 10000 neurons in about 6 seconds).

@tbekolay
Copy link
Member

FYI I'm trying to fix the TravisCI errors now, so don't worry about those.

@hunse
Copy link
Collaborator Author

hunse commented Sep 26, 2015

Doesn't it just need a rebase?

@tbekolay
Copy link
Member

No, recently Travis builds have been failing for conda-related reasons.

@Seanny123
Copy link
Contributor

Overall this commit looks good to me, but it should be noted that although I familiar with the idea of decoder solving, I'm not clear on the algorithm for randomized SVD. Eric, would you like to go over the algorithm with on Monday so I can truly say I understand this pull request?

@hunse
Copy link
Collaborator Author

hunse commented Sep 28, 2015

The algorithm isn't in our repo, I just call out to sklearn.

@Seanny123
Copy link
Contributor

Sorry, I meant the stuff you do from line 230 and onwards.

@hunse
Copy link
Collaborator Author

hunse commented Sep 28, 2015

That's the same as for the basic SVD solver. See if you can prove it for yourself, starting from the normal equation (A^T A + sigma^2 I) x = A^T y (this is an equivalent linear system to the least squares problem we want to solve) and using the fact that A = U S V, where U and V are orthogonal and S is diagonal.

@hunse hunse force-pushed the randomized-svd branch 2 times, most recently from 16fc7a9 to 44751b2 Compare September 30, 2015 20:43
@hunse hunse added this to the 2.1.0 release milestone Jan 21, 2016
@tbekolay
Copy link
Member

Rebased this and squashed the history. I used this a while ago, and it worked as advertised! Will merge tomorrow morning if there are no objections.

@tbekolay tbekolay merged commit 5836a3b into master Jan 23, 2016
@tbekolay tbekolay deleted the randomized-svd branch January 23, 2016 12:39
@jgosmann
Copy link
Collaborator

How do I use this solver? If I do model.config[nengo.Connection].solver = nengo.solvers.randomized_svd, I get ValueError: '<function randomized_svd at 0x7f0c2ab64758>' is not a solver. It seems that a corresponding class deriving from Solver is missing?

@jgosmann
Copy link
Collaborator

I think, I figured it out. It can be passed as argument to LstsqL2 class.

@hunse
Copy link
Collaborator Author

hunse commented Jan 26, 2016

Yep, exactly, you've got it. That should probably be documented better somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants