This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
simulator_config.json.txt
420 lines (392 loc) · 13.3 KB
/
simulator_config.json.txt
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
{
//all possible labels in dataset, this is used to generate non IID dataset.
"ml_dataset_all_possible_labels": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9
],
//set to true can accelerate the simulation but requires excessive memory.
"ml_delayed_test_accuracy": false,
//simulation stops at tick=2000
"ml_max_tick": 2000,
//the interval of record the weight difference
"ml_model_weight_diff_record_interval_tick": 10,
//the weight of non_iid_distribution will be randomly choosed from the range below if it's not specified in "non_iid_distribution".
"ml_non_iid_normal_weight": [
10.0,
15.0
],
//the reputation dll path
"ml_reputation_dll_path": "./libreputation_HalfFedAvg.so",
//Caffe solver path
"ml_solver_proto": "../../../dataset/MNIST/lenet_solver_memory.prototxt",
//Caffe test batch size
"ml_test_batch_size": 100,
//Caffe test dataset path
"ml_test_dataset": "../../../dataset/MNIST/t10k-images.idx3-ubyte",
//Caffe test label path
"ml_test_dataset_label": "../../../dataset/MNIST/t10k-labels.idx1-ubyte",
//Performing test on model every 10 ticks
"ml_test_interval_tick": 10,
//Caffe train batch size
"ml_train_batch_size": 64,
//Caffe train dataset path
"ml_train_dataset": "../../../dataset/MNIST/train-images.idx3-ubyte",
//Caffe train label path
"ml_train_dataset_label": "../../../dataset/MNIST/train-labels.idx1-ubyte",
//set the node topology,
/** network topology configuration
* you can use fully_connect, average_degree-{degree}, 1->2, 1--2, the topology items' order in the configuration file determines the order of adding connections.
* fully_connect: connect all nodes, and ignore all other topology items.
* average_degree-: connect the network to reach the degree for all nodes. If there are previous added topology, average_degree will add connections
* until reaching the degree and no duplicate connections.
* 1->2: add 2 as the peer of 1.
* 1--2: add 2 as the peer of 1 and 1 as the peer of 2.
*/
"node_topology": [
"fully_connect"
],
//configuration nodes
"nodes": [
{
//perform training when the node receives 10 batches of data samples.
"buffer_size": 10,
//default: randomly choose samples from dataset.
//iid: randomly choose samples from iid labels.
//non-iid: choose samples from non_iid labels, the label distribution is given in "non_iid_distribution".
"dataset_mode": "iid",
//compress ratio of the model, model size becomes smaller with larger ratio. It doesn't take effect if the "ml_model_stream_type" is set to "normal".
"filter_limit": 0.5,
//"compressed" or "normal"
"model_generation_type": "normal",
//node name
"name": "0",
//node type:
//normal: perform training + update model from other transactions.
//observer: doesn't train model, only update the model from transactions.
//malicious_model_poisoning_random_model: send malicious model with random weights to other nodes. random model = each weights * (uniform distribution among 0.7~1.3)
//malicious_model_poisoning_random_model_by_turn: send malicious model with random weights to other nodes and send normal model to other nodes by turns.
//malicious_model_poisoning_random_model_biased_0_1: add the whole model weights for (uniform distribution among 0~0.1) and send it to other nodes.
//malicious_duplication_attack: duplicate the model and send the fake transaction to other nodes.
//malicious_data_poisoning_shuffle_label: shuffle the train dataset label.
//malicious_data_poisoning_shuffle_label_biased_1: add a constant bias 1 to the train dataset label.
//malicious_data_poisoning_random_data: use random data as train dataset. random data = input tensor => uniform distribution among (0~1)
"node_type": "observer",
//this configuration doesn't take effect if the "dataset_mode" is not "non-iid"
"non_iid_distribution": {
//higher value means it's more likely to get a data sample with label 0 during training.
//possibility = weight of current label / (sum of all weights)
"0": [
0.16277609765529633,
0.16277609765529633
],
"1": [
14633.9609375,
14633.9609375
],
"2": [
47.655635833740234,
47.655635833740234
],
"3": [
2.371222496032715,
2.371222496032715
],
"4": [
1189.6182861328125,
1189.6182861328125
],
"5": [
13969.794921875,
13969.794921875
],
"6": [
14.95244312286377,
14.95244312286377
],
"7": [
19.931169509887695,
19.931169509887695
],
"8": [
22070.5078125,
22070.5078125
],
"9": [
117.93252563476563,
117.93252563476563
]
},
//perform next training after x ticks, x is randomly selected from below values. The size of data sample can be configured in "ml_train_batch_size".
"training_interval_tick": [
8,
9,
10,
11,
12
]
},
{
"buffer_size": 10,
"dataset_mode": "iid",
"filter_limit": 0.5,
"model_generation_type": "normal",
"name": "1",
"node_type": "normal",
"non_iid_distribution": {
"0": [
2.7363386154174805,
2.7363386154174805
],
"1": [
2108.41748046875,
2108.41748046875
],
"2": [
260.6585998535156,
260.6585998535156
],
"3": [
2.4482656044710893e-06,
2.4482656044710893e-06
],
"4": [
1683.9561767578125,
1683.9561767578125
],
"5": [
0.0029654994141310453,
0.0029654994141310453
],
"6": [
2544.109619140625,
2544.109619140625
],
"7": [
0.08521255105733871,
0.08521255105733871
],
"8": [
36777.44921875,
36777.44921875
],
"9": [
2.1212938090126032e-12,
2.1212938090126032e-12
]
},
"training_interval_tick": [
8,
9,
10,
11,
12
]
},
{
"buffer_size": 10,
"dataset_mode": "iid",
"filter_limit": 0.5,
"model_generation_type": "normal",
"name": "2",
"node_type": "normal",
"non_iid_distribution": {
"0": [
164.4102020263672,
164.4102020263672
],
"1": [
463.29046630859375,
463.29046630859375
],
"2": [
3612.6796875,
3612.6796875
],
"3": [
11183.939453125,
11183.939453125
],
"4": [
2.1259095668792725,
2.1259095668792725
],
"5": [
1.3096020221710205,
1.3096020221710205
],
"6": [
0.0037182033993303776,
0.0037182033993303776
],
"7": [
6.511892691740684e-10,
6.511892691740684e-10
],
"8": [
11567.4873046875,
11567.4873046875
],
"9": [
27485.904296875,
27485.904296875
]
},
"training_interval_tick": [
8,
9,
10,
11,
12
]
},
{
"buffer_size": 10,
"dataset_mode": "iid",
"filter_limit": 0.5,
"model_generation_type": "normal",
"name": "3",
"node_type": "normal",
"non_iid_distribution": {
"0": [
8.342214584350586,
8.342214584350586
],
"1": [
51.58349609375,
51.58349609375
],
"2": [
1.838113689700549e-06,
1.838113689700549e-06
],
"3": [
0.04729452729225159,
0.04729452729225159
],
"4": [
1349.2381591796875,
1349.2381591796875
],
"5": [
1579.35595703125,
1579.35595703125
],
"6": [
4349.09326171875,
4349.09326171875
],
"7": [
41078.3515625,
41078.3515625
],
"8": [
3.8783351665816826e-15,
3.8783351665816826e-15
],
"9": [
10.126914024353027,
10.126914024353027
]
},
"training_interval_tick": [
8,
9,
10,
11,
12
]
},
{
"buffer_size": 10,
"dataset_mode": "iid",
"filter_limit": 0.5,
"model_generation_type": "normal",
"name": "4",
"node_type": "normal",
"non_iid_distribution": {
"0": [
4.317836785605231e-19,
4.317836785605231e-19
],
"1": [
19622.87890625,
19622.87890625
],
"2": [
0.008417299017310143,
0.008417299017310143
],
"3": [
3.2157914638519287,
3.2157914638519287
],
"4": [
808.560302734375,
808.560302734375
],
"5": [
54919.265625,
54919.265625
],
"6": [
10.5956449508667,
10.5956449508667
],
"7": [
2866.00830078125,
2866.00830078125
],
"8": [
971.1597900390625,
971.1597900390625
],
"9": [
7459.25,
7459.25
]
},
"training_interval_tick": [
8,
9,
10,
11,
12
]
}
],
//tell user the expected finishing time every 100 ticks.
"report_time_remaining_per_tick_elapsed": 100,
"services": {
//measure accuracy every 20 ticks, the test sample size can be configured in "ml_test_batch_size".
"accuracy": {
"enable": true,
"interval": 20
},
//Debug purpose only !, replace the model in each node with the average model of whole nodes.
"force_broadcast_average": {
"broadcast_interval": 100,
"enable": false
},
//Debug purpose only !
"peer_control_service": {
"accuracy_threshold_high": 0.8,
"accuracy_threshold_low": 0.2,
"enable": false,
"fedavg_buffer_size": "linear",
"least_peer_change_interval": 50
},
//Debug purpose only !
"weights_diff": {
"enable": true,
"interval": 20
}
}
}