-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot.py
More file actions
83 lines (66 loc) · 2.36 KB
/
plot.py
File metadata and controls
83 lines (66 loc) · 2.36 KB
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
from utils.plot_utils import *
import sys
def main():
if(sys.argv[1]=="R"): #python plot.py R FAPL 30 OR python plot.py R FGPL 30
para_name = sys.argv[1]
algorithm = sys.argv[2]
dim = int(sys.argv[3])
outfile = os.path.join("results",para_name + '_'+algorithm+str(dim))
para_value = [2, 4, 6]
try:
f = open(outfile)
graph( algorithm, para_name,para_value, dim)
except IOError:
r_pca(algorithm,dim)
graph( algorithm, para_name,para_value, dim)
elif(sys.argv[1]=="rho"):
para_name = sys.argv[1]
algorithm = sys.argv[2]
dim = int(sys.argv[3])
outfile = os.path.join("results",para_name + '_'+algorithm+str(dim))
para_value = [0.1, 1, 10]
try:
f = open(outfile)
graph(algorithm, para_name,para_value, dim)
except IOError:
rho_pca(algorithm,dim)
graph( algorithm, para_name,para_value, dim)
elif(sys.argv[1]=="eta"):
para_name = sys.argv[1]
algorithm = sys.argv[2]
dim = int(sys.argv[3])
outfile = os.path.join("results", para_name + '_'+algorithm+str(dim))
etas = [0.000001, 0.0000001, 0.00000001]
etas_cifar_fapl = [0.00000002, 0.000000002, 0.0000000002]
para_value = [etas, etas_cifar_fapl]
try:
f = open(outfile)
graph(algorithm, para_name,para_value, dim)
except IOError:
print("----"* 100)
eta_pca(algorithm , dim)
graph( algorithm, para_name,para_value, dim)
elif(sys.argv[1]=="comparefixed"):
outfile = os.path.join("results","Compare_fixed30")
try:
f = open(outfile)
graph_compare(True, 30)
except IOError:
fixed = True
dim = 30
compare_fixed()
graph_compare(fixed, dim)
elif(sys.argv[1]=="compareoptimal"):
outfile = os.path.join("results","Compare_Optimal30")
try:
f = open(outfile)
graph_compare(False, 30)
except IOError:
fixed = False
dim = 30
compare_unfixed()
graph_compare(fixed, dim)
elif(sys.argv[1]=="compare"):
classification()
if __name__ == '__main__':
main()