-
Notifications
You must be signed in to change notification settings - Fork 0
/
para_task.m
97 lines (84 loc) · 1.97 KB
/
para_task.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
function para_task(i)
% stack the tasks for parallel computing
% 2018-06-13
load sInfo.mat;
fprintf('Beginning the %04dth task...... \n',i);
nCompleted=length(dir('result/*.mat'));
nTotal=(nRho+nS*nP)*4;
ratio=nCompleted/nTotal;
fprintf('The tasks have completed: %d/%d (%0.2f%%).\n\n',nCompleted,nTotal,ratio*100);
m=0;
% classification
n=m+nRho;
if m<i && i<=n
iRho=i-m;
if ~exist(sprintf('result/classify_RSPCA_%s_iRho%d.mat',FaceDB,iRho),'file')
classify_RSPCA(iRho);
end
end
m=n;
n=m+nRho;
if m<i && i<=n
iRho=i-m;
if ~exist(sprintf('result/classify_PCA2DL1S_%s_iRho%d.mat',FaceDB,iRho),'file')
classify_PCA2DL1S(iRho);
end
end
m=n;
n=m+nS*nP;
if m<i && i<=n
iTmp=i-m;
iS=floor((iTmp-1)/nP)+1;
iP=iTmp-(iS-1)*nP;
if ~exist(sprintf('result/classify_GPCA_%s_iS%d_iP%d.mat',FaceDB,iS,iP),'file')
classify_GPCA(iS,iP);
end
end
m=n;
n=m+nS*nP;
if m<i && i<=n
iTmp=i-m;
iS=floor((iTmp-1)/nP)+1;
iP=iTmp-(iS-1)*nP;
if ~exist(sprintf('result/classify_G2DPCA_%s_iS%d_iP%d.mat',FaceDB,iS,iP),'file')
classify_G2DPCA(iS,iP);
end
end
m=n;
% reconstruction
n=m+nRho;
if m<i && i<=n
iRho=i-m;
if ~exist(sprintf('result/reco_RSPCA_%s_iRho%d.mat',FaceDB,iRho),'file')
reco_RSPCA(iRho);
end
end
m=n;
n=m+nRho;
if m<i && i<=n
iRho=i-m;
if ~exist(sprintf('result/reco_PCA2DL1S_%s_iRho%d.mat',FaceDB,iRho),'file')
reco_PCA2DL1S(iRho);
end
end
m=n;
n=m+nS*nP;
if m<i && i<=n
iTmp=i-m;
iS=floor((iTmp-1)/nP)+1;
iP=iTmp-(iS-1)*nP;
if ~exist(sprintf('result/reco_GPCA_%s_iS%d_iP%d.mat',FaceDB,iS,iP),'file')
reco_GPCA(iS,iP);
end
end
m=n;
n=m+nS*nP;
if m<i && i<=n
iTmp=i-m;
iS=floor((iTmp-1)/nP)+1;
iP=iTmp-(iS-1)*nP;
if ~exist(sprintf('result/reco_G2DPCA_%s_iS%d_iP%d.mat',FaceDB,iS,iP),'file')
reco_G2DPCA(iS,iP);
end
end
m=n;