How can I do a memory efficient sparse matrix multiplication?
Mostrar comentarios más antiguos
I have a sparse matrix A (dimension 4000000 x 1000000) and I want to calculate the matrix product:
B = A * A'
This results in: "Out of memory. Type HELP MEMORY for your options."
2 comentarios
What is the density or nnz? What is its size in memory (whos), and are you able to evaluate
B = A.' ;
without generating this out of memory error?
Steffen
el 5 de Nov. de 2013
Respuestas (1)
If you only plan to use A*A' in matrix multiplication, you might be able to use my ProdCascade class
>> A=sprand(4e6, 1e6,1e-5); c=rand(4e6,1);
>> tic; B=A*A'; B*c; toc;
Out of memory. Type HELP MEMORY for your options.
>> tic; B=ProdCascade({A,A.'}); B*c; toc;
Elapsed time is 7.531522 seconds.
8 comentarios
Steffen
el 6 de Nov. de 2013
Matt J
el 6 de Nov. de 2013
True, but why calculate C*D*D.'*C.' - Y * Y.' instead of just C*D-Y ?
Steffen
el 6 de Nov. de 2013
and do a gradient descent to get a new C. Calculate a new D and E and so on...
No, it should be possible to calculate D and E just by doing
D=C\Y;
E=C\X;
Steffen
el 6 de Nov. de 2013
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!