Skip to content

Commit

Permalink
fix test acc
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamjajoo committed Jun 12, 2024
1 parent 3476061 commit e91e43b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algos/swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def run_protocol(self):
print("Node {} test_acc:{:.4f}".format(self.node_id, acc))
self.comm_utils.send_signal(dest=0, data=acc, tag=self.tag.FINISH)

test_accs = np.array([self.node_id, acc])
test_accs = np.array([[self.node_id, acc]])
existing_test_accs = np.load('./test_accs.npy') if os.path.exists('./test_accs.npy') else np.array([])
updated_test_accs = np.append(existing_test_accs, test_accs)
updated_test_accs = np.concatenate((existing_test_accs, test_accs), axis=0)
np.save('./test_accs.npy', updated_test_accs)

class SWARMServer(BaseServer):
Expand Down

0 comments on commit e91e43b

Please sign in to comment.