📄 tuckruns.m
字号:
function out=tuckruns(X,n,m,p,maxa,maxb,maxc)
% out=tuckruns(X,n,m,p,maxa,maxb,maxc)
%
% tucker3 runs with r1=1:maxdim,r2=1:maxdim,r3=1:maxdim
% uses fixed convergence criterion 1e-6;
% uses rational and four random starts
%
% Input:
% X: data
% n,m,p: order
% maxa, maxb, maxc: maximum dimensionality
% (if only maxa specified, then same for all modes)
% Output:
% out = table with columns: r1 r2 r3 fit% n_of_local_optima total_n_of_comp
%
%
% uses tuck3abk
if nargin<7,maxb=maxa;maxc=maxa;end;
if maxa>n,maxa=n;end;
if maxb>m,maxb=m;end;
if maxc>p,maxc=p;end;
conv=1e-6;
out=[];
for r1=1:maxa
for r2=1:maxb
for r3=1:maxc
func=[];
if r1*r2>=r3 & r1*r3>=r2 & r2*r3>=r1
for run=1:5
start=1;
if run==5,start=0;end;
disp(' ');
fprintf(' Analysis with %g x %g x %g, run no. %g \n',r1,r2,r3,run);
disp(' ');
[A,B,C,H,f,iter,fp,La,Lb,Lc]=tuck3abk(X,n,m,p,r1,r2,r3,start,conv);
func(run)=fp;
end;
fp=max(func);
loc=sum(func<fp*.999);
out=[out;r1 r2 r3 fp loc];
end;
end;
end;
end;
s=sum(out(:,1:3)')';
out=[out s];
[ss,si]=sort(s);
out=out(si,:);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -