From a6d5ee0d13245c6283039b4a05f28678c558ece2 Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Wed, 1 Jan 2020 12:03:23 -0800 Subject: [PATCH] SimpleRNN does the job equally well. --- 38-recurrent/tf-38.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/38-recurrent/tf-38.py b/38-recurrent/tf-38.py index 2e9296e..e5ed7bd 100644 --- a/38-recurrent/tf-38.py +++ b/38-recurrent/tf-38.py @@ -1,5 +1,5 @@ from keras.models import Sequential -from keras.layers import Dense, LSTM +from keras.layers import Dense, SimpleRNN import numpy as np import sys, os, string, random @@ -71,7 +71,7 @@ def train(model): def build_model(): model = Sequential() - model.add(LSTM(HIDDEN_SIZE, input_shape=(None, INPUT_VOCAB_SIZE))) + model.add(SimpleRNN(HIDDEN_SIZE, input_shape=(None, INPUT_VOCAB_SIZE))) model.add(Dense(INPUT_VOCAB_SIZE, activation='softmax')) return model