From 9c51b2fc1c51ede77e353e0dc87050e27c83e4df Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Tue, 31 Dec 2019 10:13:41 -0800 Subject: [PATCH] This one is perfect --- 38-rnn/tf-38.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/38-rnn/tf-38.py b/38-rnn/tf-38.py index 6a24bb8..f077601 100644 --- a/38-rnn/tf-38.py +++ b/38-rnn/tf-38.py @@ -21,6 +21,7 @@ def encode_one_hot(line): # remain = len(line) % TIME_STEPS # if remain != 0: # line = line + ' ' * (TIME_STEPS-remain) + line = " " + line x = np.zeros((len(line), INPUT_VOCAB_SIZE)) for i, c in enumerate(line): index = char_indices[c] if c in characters else char_indices[' '] @@ -50,7 +51,7 @@ def input_generator(nsamples): c = random.choice(characters) expected = c.lower() if c in string.ascii_letters else ' ' inline.append(c); outline.append(expected) - inline.append(' ') + inline.append(' '); for i in range(nsamples): if outline[i] == ' ': continue if i > 0 and i < nsamples-1: