From e91e43b470868ebafa2c5a6105bf9e899772cb0b Mon Sep 17 00:00:00 2001 From: gautamjajoo Date: Wed, 12 Jun 2024 17:35:21 +0530 Subject: [PATCH] fix test acc --- src/algos/swarm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algos/swarm.py b/src/algos/swarm.py index dfe93a0..c60b02c 100644 --- a/src/algos/swarm.py +++ b/src/algos/swarm.py @@ -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):