This is an RNN layer consisting of one GRUCell. However, unlike
the underlying GRUCell, the apply method of SimpleRNN operates
on a sequence of inputs. The shape of the input (not including the first,
batch dimension) needs to be at least 2-D, with the first dimension being
time steps. For example:
// Create an input with 10 time steps. constinput = tf.input({shape: [10, 20]}); constoutput = rnn.apply(input);
console.log(JSON.stringify(output.shape)); // [null, 10, 8]: 1st dimension is unknown batch size; 2nd dimension is the // same as the sequence length of `input`, due to `returnSequences`: `true`; // 3rd dimension is the `GRUCell`'s number of units.
Gated Recurrent Unit - Cho et al. 2014.
This is an
RNN
layer consisting of oneGRUCell
. However, unlike the underlyingGRUCell
, theapply
method ofSimpleRNN
operates on a sequence of inputs. The shape of the input (not including the first, batch dimension) needs to be at least 2-D, with the first dimension being time steps. For example: