From 645c1a2727cdfb4b7149e18423609c4691a11613 Mon Sep 17 00:00:00 2001 From: Mikhail Simin Date: Sun, 4 Oct 2020 10:43:16 -0700 Subject: [PATCH] Remove MANY oldest trainExamples if needed If the value for `numItersForTrainExamplesHistory` is adjusted mid training the Coach was only removing at most 1 old value. This change removes old values until the new history size is correct. --- Coach.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Coach.py b/Coach.py index 9d228a07b..eb3944b4e 100644 --- a/Coach.py +++ b/Coach.py @@ -91,7 +91,7 @@ def learn(self): # save the iteration examples to the history self.trainExamplesHistory.append(iterationTrainExamples) - if len(self.trainExamplesHistory) > self.args.numItersForTrainExamplesHistory: + while len(self.trainExamplesHistory) > self.args.numItersForTrainExamplesHistory: log.warning( f"Removing the oldest entry in trainExamples. len(trainExamplesHistory) = {len(self.trainExamplesHistory)}") self.trainExamplesHistory.pop(0)