Skip to content

Commit

Permalink
fix global steps
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterxgchen authored and IsaacYangSLA committed May 9, 2024
1 parent 764f118 commit 5171404
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def evaluate(input_weights):
running_loss += loss.item()
if i % 2000 == 1999: # print every 2000 mini-batches
print(f"({client_id}) [{epoch + 1}, {i + 1:5d}] loss: {running_loss / 2000:.3f}")
global_step = input_model.current_round * local_epochs * batch_size + epoch * batch_size + i
global_step = input_model.current_round * steps + epoch * len(trainloader) + i
mlflow.log_metric("loss", running_loss / 2000, global_step)
running_loss = 0.0

Expand Down

0 comments on commit 5171404

Please sign in to comment.