Out Of Memory -- large Matrix Multiplication

Hi there, In NMF (Non-negative Matrix Factorization) a matrix A is decomposed into two matrices W and H, which we can write: A ≈ W*H .
My matrix ‘A’ is a term-document, sparse large matrix, with dimensions 72000×12000, The basis vectors matrix ‘W’ has dimensions as 720000×7, and 'H' that is the coefficients matrix has dimensions as 7 ×12000 .
The NMF approach is an iterative refinement of 'W' and 'H'. 'W' and 'H' matrices are not necessarily sparse. In each iteration of the refinement algorithm there is a ‘Stop Condition’ that checks whether the approximation error (A-W*H in Frobenius norm) is small enough or not. The Stop Condition requires the computation of W*H that fails because of not enough memory.
The line in my code that results in the error is as follows:
obj = norm(X-W*H,'fro');
The error message is :
Error using ==> mtimes Out of memory.
In fact, the error is not strange, and I expect this error because of not enough memory. I’ve tested different approaches like defining 'W' and 'H' as sparse matrices or using ssmult mexFunction, but the problem is still continued. How can we overcome lack of memory in these situations? I need to check for Stop Condition. I have a 64bit OS and 4GB of RAM. Any suggestion is appreciated.

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Asked:

on 16 Jun 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!