From af686978c969f3680fee5eeba95f8bf777ae0c3c Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Wed, 17 Mar 2021 16:19:04 -0400 Subject: [PATCH 1/2] add group done to ELO computation --- ml-agents/mlagents/trainers/ghost/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml-agents/mlagents/trainers/ghost/trainer.py b/ml-agents/mlagents/trainers/ghost/trainer.py index cd08ee24f0..fe368052d9 100644 --- a/ml-agents/mlagents/trainers/ghost/trainer.py +++ b/ml-agents/mlagents/trainers/ghost/trainer.py @@ -190,7 +190,7 @@ def _process_trajectory(self, trajectory: Trajectory) -> None: i.e. in asymmetric games. We assume the last reward determines the winner. :param trajectory: Trajectory. """ - if trajectory.done_reached: + if trajectory.done_reached and trajectory.all_group_dones_reached: # Assumption is that final reward is >0/0/<0 for win/draw/loss final_reward = ( trajectory.steps[-1].reward + trajectory.steps[-1].group_reward From 8a448956310e1258a5f8beeb5454812a32d92124 Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Wed, 17 Mar 2021 16:22:53 -0400 Subject: [PATCH 2/2] add not interrupted --- ml-agents/mlagents/trainers/ghost/trainer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ml-agents/mlagents/trainers/ghost/trainer.py b/ml-agents/mlagents/trainers/ghost/trainer.py index fe368052d9..2449734b75 100644 --- a/ml-agents/mlagents/trainers/ghost/trainer.py +++ b/ml-agents/mlagents/trainers/ghost/trainer.py @@ -190,7 +190,11 @@ def _process_trajectory(self, trajectory: Trajectory) -> None: i.e. in asymmetric games. We assume the last reward determines the winner. :param trajectory: Trajectory. """ - if trajectory.done_reached and trajectory.all_group_dones_reached: + if ( + trajectory.done_reached + and trajectory.all_group_dones_reached + and not trajectory.interrupted + ): # Assumption is that final reward is >0/0/<0 for win/draw/loss final_reward = ( trajectory.steps[-1].reward + trajectory.steps[-1].group_reward