Skip to content

Commit

Permalink
remove redundant eval hook for pFedMe (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
yxdyc authored Aug 17, 2022
1 parent c0adbfc commit f16ec74
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions federatedscope/core/trainers/trainer_pFedMe.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ def wrap_pFedMeTrainer(
# 1) cache the original hooks for "on_batch_start"
base_trainer.ctx.original_hook_on_batch_start_train = \
base_trainer.hooks_in_train["on_batch_start"]
base_trainer.ctx.original_hook_on_batch_start_eval = \
base_trainer.hooks_in_eval["on_batch_start"]
# 2) replace the original hooks for "on_batch_start"
base_trainer.replace_hook_in_train(
new_hook=hook_on_batch_start_init_pfedme,
target_trigger="on_batch_start",
target_hook_name=None)
base_trainer.replace_hook_in_eval(new_hook=hook_on_batch_start_init_pfedme,
target_trigger="on_batch_start",
target_hook_name=None)

return base_trainer

Expand Down

0 comments on commit f16ec74

Please sign in to comment.