1
votes

In the documentation for SimpleRNN (https://keras.io/layers/recurrent/#simplernncell), it is described as a "Fully-connected RNN where the output is to be fed back to input".

Is there a straightforward way to use this layer (or another built in method) so that I can feed in new inputs (instead of using the outputs from the previous time step)?

e.g., I have a sequence of a thousand numbers

[1 2 3 4 5, ..., 999, 1000]

which I would want to feed into the RNN over 1000 timesteps.

Mathematically, this is equivalent to having the system:

enter image description here

as opposed to:

enter image description here

1
I came to the same conclusion... simpleRNN seems to feed in the output of the previous layer. Did you find the answer to your question?FenryrMKIII

1 Answers

0
votes

The number of time-steps can be controlled using the input_shape parameter.

model = Sequential()
model.add(SimpleRNN(300, input_shape=(1,1)))

(1,1) => timestep=1, input_feature_size=1