diff --git a/generator/ctrl/training_utils/training.py b/generator/ctrl/training_utils/training.py index e439fdd..4b9c787 100644 --- a/generator/ctrl/training_utils/training.py +++ b/generator/ctrl/training_utils/training.py @@ -142,7 +142,7 @@ def loss(labels, logits): # the optimizer is not used since this code only supports inference # however, to compile the model, we still define it optimizer = tf.contrib.estimator.clip_gradients_by_norm( - tf.train.AdagradOptimizer(learning_rate=3e-3), 0.25) + tf.train.AdagradOptimizer(learning_rate=1e-2), 0.25) # compile the model with the optimizer and loss model.compile(optimizer=optimizer, loss=loss) diff --git a/story/story_manager.py b/story/story_manager.py index c1bec84..c2ee15d 100644 --- a/story/story_manager.py +++ b/story/story_manager.py @@ -41,9 +41,7 @@ class Story(): self.results.append(story_block) def latest_result(self): - if len(self.results) >= 2: - return self.context + self.results[-2] + self.actions[-1] + self.results[-1] - elif len(self.results) >= 1: + if len(self.results) >= 1: return self.context + self.actions[-1] + self.results[-1] else: return self.context + self.story_start