Missed TensorFlow World? Check out the recap. Learn more

tf.nn.rnn_cell.MultiRNNCell

View source on GitHub

Class MultiRNNCell

RNN cell composed sequentially of multiple simple cells.

Inherits From: RNNCell

Aliases:

  • Class tf.compat.v1.nn.rnn_cell.MultiRNNCell
  • Class tf.contrib.rnn.MultiRNNCell

Example:

num_units = [128, 64]
cells = [BasicLSTMCell(num_units=n) for n in num_units]
stacked_rnn_cell = MultiRNNCell(cells)

__init__

View source

__init__(
    cells,
    state_is_tuple=True
)

Create a RNN cell composed sequentially of a number of RNNCells. (deprecated)

Args:

  • cells: list of RNNCells that will be composed in this order.
  • state_is_tuple: If True, accepted and returned states are n-tuples, where n = len(cells). If False, the states are all concatenated along the column axis. This latter behavior will soon be deprecated.

Raises:

  • ValueError: if cells is empty (not allowed), or at least one of the cells returns a state tuple but the flag state_is_tuple is False.

Properties

graph

DEPRECATED FUNCTION

output_size

scope_name

state_size

Methods

get_initial_state

View source

get_initial_state(
    inputs=None,
    batch_size=None,
    dtype=None
)

zero_state

View source

zero_state(
    batch_size,
    dtype
)