-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathRunRepLearning.m
100 lines (69 loc) · 6.34 KB
/
RunRepLearning.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
98
99
100
function RunRepLearning(DataSetStartIndex, DataSetEndIndex, Method, gamma)
Methods = [cellstr('Random'), 'KShape'];
% first 2 values are '.' and '..' - UCR Archive 2018 version has 128 datasets
dir_struct = dir('/rigel/dsi/users/ikp2103/VLDBGRAIL/UCR2018/');
Datasets = {dir_struct(3:130).name};
% Sort Datasets
[Datasets, DSOrder] = sort(Datasets);
for i = 1:length(Datasets)
if (i>=DataSetStartIndex && i<=DataSetEndIndex)
display(['Dataset being processed: ', char(Datasets(i))]);
DS = LoadUCRdataset(char(Datasets(i)));
for rep = 1 : 1
rep
rng(rep);
%if (rep>=RepStartIndex & rep<=RepEndIndex)
%for gamma = 1 : 20
gamma
if Method==1
Dictionary = dlmread( strcat( 'DICTIONARIESRANDOM/',char(Datasets(i)),'/','RunDLFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Dictionary') );
elseif Method==2
Dictionary = dlmread( strcat( 'DICTIONARIESKSHAPE/',char(Datasets(i)),'/','RunDLFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Dictionary') );
end
[Zexact, Ztop5, Ztop10, Ztop20, Z99per, Z98per, Z97per, Z95per, Z90per, Z85per, Z80per, DistComp, RuntimeNystrom, RuntimeFD]=RepLearnFINAL(DS.Data, Dictionary, gamma);
Results = [DistComp, RuntimeNystrom, RuntimeFD];
%myflag = true;
%count=0;
%while(myflag)
%try
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Zexact'), Zexact, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Ztop5'), Ztop5, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Ztop10'), Ztop10, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Ztop20'), Ztop20, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z99per'), Z99per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z98per'), Z98per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z97per'), Z97per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z95per'), Z95per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z90per'), Z90per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z85per'), Z85per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RepLearningFixedSamples', '_', char(Methods(Method)), '_', num2str(rep) ,'.Z80per'), Z80per, 'delimiter', '\t');
pause(5);
dlmwrite( strcat( 'REPRESENTATIONSGamma', num2str(gamma),'/',char(Datasets(i)),'/','RESULTS_RepLearningFixedSamples_', char(Methods(Method)), '_',num2str(rep) ,'.Results'), Results, 'delimiter', '\t');
%myflag = false;
%%%%%%%%fclose('all') ;
%catch
% disp('attempt to write failed - trying again');
% pause(30+rep+gamma)
%end
%count=count+1;
%if count==5
% disp('5 attempts! - I quit!');
% break;
%end
%end
%end
%end
end
end
end
end