# Singular value decomposition, Cant get the final results

3 views (last 30 days)
M on 29 Nov 2023
Edited: Matt J on 30 Nov 2023
Im trying to Perform SVD as the following, My laptop RAM is 64GB
The XTrain size is 120*120*1*39000
I tried to reduce the number of matrices to 120*120*1*10000, but still getting the same message
But the MATLAB stucks in this message and the evaluation percentage doesnt increase, any suggestion please?
N=14;
X=reshape(XTrain,[], size(XTrain,4)).';
size(X)
vn=max([vecnorm(X,inf,1),1],1);
%Process as tall
T=tall([X, ones(height(X),1)]./vn);
clear X
[~,~,V]=svd( T , "econ");
clear T
Abt=gather( head( V(:,end+1-N:end)) ) ./vn';
A=Abt(1:end-1,:)';
b=Abt(end,:)';
s=vecnorm(A,2,2);
[A,b]=deal(A./s, b./s);
Message
Evaluating tall expression using the Parallel Pool 'Processes':
- Pass 1 of 2: Completed in 7.1 sec
Evaluation 45% complete
Torsten on 29 Nov 2023
But the MATLAB stucks in this message and the evaluation percentage doesnt increase, any suggestion please?
My advice was: Contact Technical Support.
If your question was: Do you know if I do something wrong ? How can I get the affine subspace and the Grassman manifold ? - then I'm not able to contribute something.
Matt J on 30 Nov 2023
Have you tried leaving it to run overnight? Maybe it just takes a while.

Matt J on 30 Nov 2023
Moved: Matt J on 30 Nov 2023
Since you are now on a more powerful computer with more RAM, perhaps you should also try doing the SVD without tall arrays.
Regardless, you should probably clear XTrain from memory as soon as it is no longer needed,
X=reshape(XTrain,[], size(XTrain,4)).'; clear XTrain
so as to maximize available RAM.
You might also consider using single floats to reduce RAM consumption as well,
X=reshape(single(XTrain),[], size(XTrain,4)).'; clear XTrain
although I am not sure what impact the reduced precision will have on the SVD results.
##### 2 CommentsShow NoneHide None
M on 30 Nov 2023
Moved: Matt J on 30 Nov 2023
@Matt J perhaps you should also try doing the SVD without tall arrays.
Thanks Matt, This worked. But I am wondered how it's working and the tall array which is supposed to work in less memory is not working.
Matt J on 30 Nov 2023
Edited: Matt J on 30 Nov 2023
Thanks Matt, This worked.
I'm glad, but please Accept-click the answer to indicate so.
But I am wondered how it's working and the tall array which is supposed to work in less memory is not working.
We don't know that it is "not working" with tall arrays. It's possible you didn't wait long enough.

### Categories

Find more on Logical in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!