svd

SVD for sparse matrix in R

允我心安 提交于 2019-11-26 21:00:03
问题 I've got a sparse Matrix in R that's apparently too big for me to run as.matrix() on (though it's not super-huge either). The as.matrix() call in question is inside the svd() function, so I'm wondering if anyone knows a different implementation of SVD that doesn't require first converting to a dense matrix. 回答1: The irlba package has a very fast SVD implementation for sparse matrices. 回答2: You can do a very impressive bit of sparse SVD in R using random projection as described in http://arxiv

Parallel implementation for multiple SVDs using CUDA

瘦欲@ 提交于 2019-11-26 20:45:21
问题 I'm new to parallel programming using GPU so I apologize if the question is broad or vague. I'm aware there is some parallel SVD function in the CULA library, but what should be the strategy if I have a large number of relatively small matrices to factorize? For example I have n matrices with dimension d , n is large and d is small. How to parallelize this process? Could anyone give me a hint? 回答1: My previous answer is now out-of-date. As of February 2015, CUDA 7 (currently in release

Python (NumPy, SciPy), finding the null space of a matrix

百般思念 提交于 2019-11-26 16:25:23
I'm trying to find the null space (solution space of Ax=0) of a given matrix. I've found two examples, but I can't seem to get either to work. Moreover, I can't understand what they're doing to get there, so I can't debug. I'm hoping someone might be able to walk me through this. The documentation pages ( numpy.linalg.svd , and numpy.compress ) are opaque to me. I learned to do this by creating the matrix C = [A|0] , finding the reduced row echelon form and solving for variables by row. I can't seem to follow how it's being done in these examples. Thanks for any and all help! Here is my sample

MATLAB eig returns inverted signs sometimes

时光怂恿深爱的人放手 提交于 2019-11-26 12:46:38
问题 I\'m trying to write a program that gets a matrix A of any size, and SVD decomposes it: A = U * S * V\' Where A is the matrix the user enters, U is an orthogonal matrix composes of the eigenvectors of A * A\' , S is a diagonal matrix of the singular values, and V is an orthogonal matrix of the eigenvectors of A\' * A . Problem is: the MATLAB function eig sometimes returns the wrong eigenvectors. This is my code: function [U,S,V]=badsvd(A) W=A*A\'; [U,S]=eig(W); max=0; for i=1:size(W,1) %%sort

Python (NumPy, SciPy), finding the null space of a matrix

别来无恙 提交于 2019-11-26 04:46:20
问题 I\'m trying to find the null space (solution space of Ax=0) of a given matrix. I\'ve found two examples, but I can\'t seem to get either to work. Moreover, I can\'t understand what they\'re doing to get there, so I can\'t debug. I\'m hoping someone might be able to walk me through this. The documentation pages (numpy.linalg.svd, and numpy.compress) are opaque to me. I learned to do this by creating the matrix C = [A|0] , finding the reduced row echelon form and solving for variables by row. I