Skip to content

Commit 0911fa0

Browse files
committed
reset clients and client model weights moved to init epoch fn
1 parent fa17000 commit 0911fa0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

fed_learn/fed_server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ def send_model(self, client):
6767
client.receive_and_init_model(self.model_fn, self.global_model_weights)
6868

6969
def init_for_new_epoch(self):
70+
# Reset clients
71+
self.clients = []
72+
# Reset the collected weights
73+
self.client_model_weights = []
74+
# Generate new data indices for the clients
7075
self._generate_data_indices()
7176

7277
def receive_results(self, client):
@@ -75,9 +80,6 @@ def receive_results(self, client):
7580
client.reset_model()
7681

7782
def create_clients(self):
78-
# Reset clients
79-
self.clients = []
80-
8183
# Create new ones
8284
for i in range(self.nb_clients):
8385
client = fed_learn.Client(i)

0 commit comments

Comments
 (0)