Base class for recurrent layers.
cell, return_sequences=False, return_state=False, go_backwards=False,
stateful=False, unroll=False, time_major=False, **kwargs
Used in the notebooks
See the Keras RNN API guide
for details about the usage of RNN API.
A RNN cell instance or a list of RNN cell instances.
A RNN cell is a class that has:
call(input_at_t, states_at_t) method, returning
(output_at_t, states_at_t_plus_1). The call method of the
cell can also take the optional argument
section "Note on passing external constants" below.
state_size attribute. This can be a single integer
(single state) in which case it is the size of the recurrent
state. This can also be a list/tuple of integers (one size per state).
state_size can also be TensorShape or tuple/list of
TensorShape, to represent high dimension state.
output_size attribute. This can be a single integer or a
TensorShape, which represent the shape of the output. For backward
compatible reason, if this attribute is not available for the
cell, the value will be inferred by the first element of the
get_initial_state(inputs=None, batch_size=None, dtype=None)
method that creates a tensor meant to be fed to
call() as the
initial state, if the user didn't specify any initial state via other
means. The returned initial state should have a shape of
[batch_size, cell.state_size]. The cell might choose to create a
tensor full of zeros, or full of other values based on the cell's
inputs is the input tensor to the RNN layer, which should
contain the batch size as its shape, and also dtype. Note that
the shape might be
None during the graph construction. Either