Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerroth committed Nov 22, 2024
1 parent 5491825 commit ebddb1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nvflare/app_opt/tf/fedopt_ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ def update_model(self, global_model: FLModel, aggr_result: FLModel):
aggr_result.params[key] - param
if aggr_result.params_type == ParamsType.FULL
else aggr_result.params[key]
)
)
w_idx += 1

model_diff = self._to_tf_params_list(model_diff_params, negate=True)

# Apply model diffs as gradients, using the optimizer.
start = time.time()

self.optimizer.apply_gradients(zip(model_diff, global_params))
secs = time.time() - start

# Convert updated global model weights to
# numpy format for FLModel.
start = time.time()
Expand Down

0 comments on commit ebddb1e

Please sign in to comment.