-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain_plot_mnist.py
140 lines (126 loc) · 5.85 KB
/
main_plot_mnist.py
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/env python
import h5py
import matplotlib.pyplot as plt
import numpy as np
import argparse
import importlib
import random
import os
from utils.plot_utils import *
import torch
torch.manual_seed(0)
#!/usr/bin/env python
import h5py
import matplotlib.pyplot as plt
import numpy as np
import argparse
import importlib
import random
import os
from algorithms.server.server import Server
from algorithms.trainmodel.models import *
from utils.plot_utils import *
import torch
torch.manual_seed(0)
num_glob_iters = 100
if(1):
dataset = "Mnist"
numedges = [32, 32, 32, 32, 32, 32, 32, 32, 32, 32]
local_epochs = [10,20,30,40,40,40,40,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.03,0.03,0.03,0.03,0.005,0.01,0.02,0.03]
eta = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
batch_size = [0,0,0,0,0,0,0,0,0,0,0,0]
algorithms = ["DONE","DONE", "DONE", "DONE", "DONE", "DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
#kappa = [4,4,4,4,4,4,9,9,9,9,9,9]
plot_summary_mnist_R_and_alpha(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "human_activity"
numedges = [30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
local_epochs = [10,20,30,40,40,40,40,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.02,0.02,0.02,0.02,0.005,0.01,0.015,0.02]
eta = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
batch_size = [0,0,0,0,0,0,0,0,0,0,0,0]
algorithms = ["DONE","DONE", "DONE", "DONE", "DONE", "DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
#kappa = [4,4,4,4,4,4,9,9,9,9,9,9]
plot_summary_human_R_and_alpha(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "Nist"
numedges = [32, 32, 32, 32, 32, 32, 32, 32, 32, 32]
local_epochs = [10,20,30,40,40,40,40,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.01,0.01,0.01,0.01,0.004,0.006,0.008,0.01]
eta = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
batch_size = [0,0,0,0,0,0,0,0,0,0,0,0]
algorithms = ["DONE","DONE", "DONE", "DONE", "DONE", "DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_nist_R_and_alpha(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "Mnist"
numedges = [32, 32, 32, 32]
local_epochs = [120,120,120,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.01,0.01,0.01,0.03]
eta = [1.0, 1.0, 1.0, 1.0]
batch_size = [32,64,128,0]
algorithms = ["DONE","DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_mnist_batch(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "Nist"
numedges = [32, 32, 32, 32]
local_epochs = [80,80,80,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.005,0.005,0.005,0.01]
eta = [1.0, 1.0, 1.0, 1.0]
batch_size = [32,64,128,0]
algorithms = ["DONE","DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_nist_batch(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "human_activity"
numedges = [30, 30, 30, 30]
local_epochs = [80,80,80,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.01,0.01,0.01,0.02]
eta = [1.0, 1.0, 1.0, 1.0]
batch_size = [32, 64,128,0]
algorithms = ["DONE","DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_human_batch(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "Mnist"
numedges = [13, 20, 26, 32]
local_epochs = [40,40,40,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.03,0.03,0.03,0.03]
eta = [1.0, 1.0, 1.0, 1.0]
batch_size = [0,0,0,0]
algorithms = ["DONE","DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_mnist_edge(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "Nist"
numedges = [13, 20, 26, 32]
local_epochs = [40,40,40,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.01,0.01,0.01,0.01]
eta = [1.0, 1.0, 1.0, 1.0]
batch_size = [0,0,0,0]
algorithms = ["DONE","DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_nist_edge(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)
if(1):
dataset = "human_activity"
numedges = [12, 18, 24, 30]
local_epochs = [40,40,40,40]
learning_rate = [1,1,1,1,1,1,1,1]
alpha = [0.02,0.02,0.02,0.02]
eta = [1.0, 1.0, 1.0, 1.0]
batch_size = [0,0,0,0]
algorithms = ["DONE","DONE", "DONE", "DONE"]
L = [0,0,0,0,0,0,0,0,0,0,0,0]
plot_summary_human_edge(num_users=numedges, loc_ep1=local_epochs, Numb_Glob_Iters=num_glob_iters, lamb=L, learning_rate=learning_rate, alpha = alpha, eta = eta, algorithms_list=algorithms, batch_size=batch_size, dataset=dataset)