Singular value decomposition, Cant get the final results
1 次查看(过去 30 天)
显示 更早的评论
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
8 个评论
Torsten
2023-11-29
Your question was
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
2023-11-30
移动:Matt J
2023-11-30
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 个评论
Matt J
2023-11-30
编辑:Matt J
2023-11-30
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!