(rnn_layer_sizes,
                  dropout_keep_prob=1.0,
                  attn_length=0,
                  base_cell=rnn.BasicLSTMCell,
                  residual_connections=False)
return cell
Makes a RNN cell from the given hyperparameters.

  Args:
    rnn_layer_sizes: A list of integer sizes (in units) for each layer of the
        RNN.
    dropout_keep_prob: The float probability to keep the output of any given
        sub-cell.
    attn_length: The size of the attention vector.
    base_cell: The base rnn.RNNCell to use for sub-cells.
    residual_connections: Whether or not to use residual connections (via
        rnn.ResidualWrapper).

  Returns:
      A rnn.MultiRNNCell based on the given hyperparameters.
Makes a RNN cell from the given hyperparameters.
Makes a RNN cell from the given hyperparameters .
def make_rnn_cell(rnn_layer_sizes,
                  dropout_keep_prob=1.0,
                  attn_length=0,
                  base_cell=rnn.BasicLSTMCell,
                  residual_connections=False):
  """Makes a RNN cell from the given hyperparameters.

  Args:
    rnn_layer_sizes: A list of integer sizes (in units) for each layer of the
        RNN.
    dropout_keep_prob: The float probability to keep the output of any given
        sub-cell.
    attn_length: The size of the attention vector.
    base_cell: The base rnn.RNNCell to use for sub-cells.
    residual_connections: Whether or not to use residual connections (via
        rnn.ResidualWrapper).

  Returns:
      A rnn.MultiRNNCell based on the given hyperparameters.
  """
  cells = []
  for i in range(len(rnn_layer_sizes)):
    cell = base_cell(rnn_layer_sizes[i])
    if attn_length and not cells:
      # Add attention wrapper to first layer.
      cell = contrib_rnn.AttentionCellWrapper(
          cell, attn_length, state_is_tuple=True)
    if residual_connections:
      cell = rnn.ResidualWrapper(cell)
      if i == 0 or rnn_layer_sizes[i] != rnn_layer_sizes[i - 1]:
        cell = contrib_rnn.InputProjectionWrapper(cell, rnn_layer_sizes[i])
    cell = rnn.DropoutWrapper(
        cell, output_keep_prob=dropout_keep_prob)
    cells.append(cell)

  cell = rnn.MultiRNNCell(cells)

  return cell
def make_rnn_cell ( rnn_layer_sizes , dropout_keep_prob = 1.0 , attn_length = 0 , base_cell = rnn . BasicLSTMCell , residual_connections = False ) : cells = [ ] for i in range ( len ( rnn_layer_sizes ) ) : cell = base_cell ( rnn_layer_sizes [ i ] ) if attn_length and not cells : # Add attention wrapper to first layer. cell = contrib_rnn . AttentionCellWrapper ( cell , attn_length , state_is_tuple = True ) if residual_connections : cell = rnn . ResidualWrapper ( cell ) if i == 0 or rnn_layer_sizes [ i ] != rnn_layer_sizes [ i - 1 ] : cell = contrib_rnn . InputProjectionWrapper ( cell , rnn_layer_sizes [ i ] ) cell = rnn . DropoutWrapper ( cell , output_keep_prob = dropout_keep_prob ) cells . append ( cell ) cell = rnn . MultiRNNCell ( cells ) return cell