This commit is contained in:
root
2019-10-30 22:41:56 +00:00
parent 49c31d2cb3
commit e76964e307
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -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)
+1 -3
View File
@@ -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