Base class for recurrent layers.

Inherits From: Layer, Module

Used in the notebooks

Used in the guide Used in the tutorials

See the Keras RNN API guide for details about the usage of RNN API.

cell A RNN cell instance or a list of RNN cell instances. A RNN cell is a class that has:

  • A 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 constants, see section "Note on passing external constants" below.
  • A 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). The state_size can also be TensorShape or tuple/list of TensorShape, to repre