Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit 897e441

Browse files
author
Joeri Hermans
committed
Fix Dynamic SGD staleness consistency
1 parent 6f4265e commit 897e441

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

distkeras/parameter_servers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,16 @@ def handle_pull(self, conn, addr):
326326
conn: socket. The opened connection.
327327
addr: addr. Address of the remote host.
328328
"""
329+
# Allocate a new dictionary.
330+
data = {}
329331
# Fetch the raw center variables.
330332
with self.mutex:
331333
center_variable = self.model.get_weights()
332334
cv = copy.deepcopy(center_variable)
333-
# Allocate a new dictionary.
334-
data = {}
335+
# Store the number of updates (u) the PS executed.
336+
data['update'] = self.num_updates
335337
# Store the model (m).
336338
data['model'] = cv
337-
# Store the number of updates (u) the PS executed.
338-
data['update'] = self.num_updates
339339
# Send the data over the socket.
340340
send_data(conn, data)
341341

0 commit comments

Comments
 (0)