Skip to content

Commit

Permalink
formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
joneswong committed Feb 10, 2023
1 parent 304e0ab commit a0dd220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion federatedscope/contrib/trainer/local_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def run_epoch(self, optimizer, criterion, current_global_model, mu):
outputs = self.model(inputs)
ce_loss = criterion(outputs, targets)
loss = ce_loss + self._thermal * prox_term(self.model.state_dict(),
current_global_model)
current_global_model)
loss.backward()
optimizer.step()

Expand Down
4 changes: 3 additions & 1 deletion federatedscope/core/aggregators/fedopt_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def __init__(self, config, model, device='cpu'):
if config.fedopt.annealing:
self._annealing = True
# TODO: generic scheduler construction
self.scheduler = torch.optim.lr_scheduler.StepLR(self.optimizer, step_size=4000, gamma=0.2)
self.scheduler = torch.optim.lr_scheduler.StepLR(self.optimizer,
step_size=4000,
gamma=0.2)
else:
self._annealing = False

Expand Down

0 comments on commit a0dd220

Please sign in to comment.