Skip to content

Commit 1c8aef2

Browse files
authoredJan 25, 2023
Update defed.py
1 parent 4c07e74 commit 1c8aef2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎CWRU/defed.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,19 @@
199199
local_weights_grad_sel = [local_weights_grad[i] for i in user_sel]
200200
for ind, idx in enumerate(user_sel):
201201
w_weights = W[:, ind]
202-
mu = 0.1
202+
mu = 1
203203
global_weights = average_weights_new(local_weights_sel, local_weights_grad_sel, w_weights, ind, mu)
204204
global_model_i[idx].load_state_dict(global_weights)
205205
for idx in user_else: # 未连接的节点也按步长更新
206-
mu = 0.1
206+
mu = 1
207207
global_weights = unsel_weights_new(local_weights[idx], local_weights_grad[idx], mu)
208208
global_model_i[idx].load_state_dict(global_weights)
209209

210210
else:
211211
for ind in range(len(idxs_users)):
212212
# update global weights
213213
w_weights = W[:,ind]
214-
mu = 0.1
214+
mu = 1
215215
global_weights = average_weights_new(local_weights, local_weights_grad, w_weights, ind, mu)
216216
# global_weights = average_weights_w(local_weights_new, w_weights)
217217
# update global weights

0 commit comments

Comments
 (0)
Please sign in to comment.