Skip to content

Commit 859775b

Browse files
committed
main script extended with info prints
1 parent 3ec22c7 commit 859775b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

fl.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@ def model_fn():
1212
server = fed_learn.Server(model_fn, NB_CLIENTS, weight_summarizer)
1313

1414
for epoch in range(NB_EPOCHS):
15+
print("Global Epoch {0} is starting".format(epoch))
16+
server.create_clients()
1517
server.init_for_new_epoch()
1618

19+
loss = []
20+
1721
for client in server.clients:
22+
print("Client {0} is starting the training".format({client.id}))
23+
1824
server.send_model(client)
1925
server.send_train_data(client)
2026

21-
client.edge_train(server.get_client_train_param_dict())
27+
hist = client.edge_train(server.get_client_train_param_dict())
28+
loss.append(hist.history["loss"])
2229

2330
server.receive_results(client)
2431

2532
server.summarize_weights()
33+
print("-" * 30)
34+
2635
# TODO: test the base model with the aggregated weights

0 commit comments

Comments
 (0)