Skip to content

Commit b370cc9

Browse files
committed
Update function.py
1 parent 7e9f403 commit b370cc9

File tree

1 file changed

+2
-3
lines changed
  • golf_federated/server/process/strategy/aggregation

1 file changed

+2
-3
lines changed

golf_federated/server/process/strategy/aggregation/function.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,15 @@ def Cedarsyn(
422422
else:
423423
judge_sign = 0
424424
if judge_sign == 0:
425-
if (global_param is None or id == 0):
425+
if j == 0:
426426
param_tem = Variable(torch.zeros_like(global_param))
427427
global_param.data.copy_(param_tem.data)
428428
global_param.data.add_(client_param.data * aggregate_percentage[j])
429429
else:
430-
if (global_param is None or id == 0):
430+
if j == 0:
431431
param_tem = Variable(torch.zeros_like(global_param))
432432
global_param.data.copy_(param_tem.data)
433433
for layer in require_judge_layer:
434-
435434
if global_name.__contains__(layer):
436435
idx = list(require_judge_layer).index(layer)
437436
if upgrade_bool_list[j][idx] == 1:

0 commit comments

Comments
 (0)