(rnn_cell_size, dropout_keep_prob, residual, is_training=True)
return rnn.MultiRNNCell(cells)
Builds an LSTMBlockCell based on the given parameters.
Builds an LSTMBlockCell based on the given parameters.
Builds an LSTMBlockCell based on the given parameters .
def rnn_cell(rnn_cell_size, dropout_keep_prob, residual, is_training=True):
  """Builds an LSTMBlockCell based on the given parameters."""
  dropout_keep_prob = dropout_keep_prob if is_training else 1.0
  cells = []
  for i in range(len(rnn_cell_size)):
    cell = contrib_rnn.LSTMBlockCell(rnn_cell_size[i])
    if residual:
      cell = rnn.ResidualWrapper(cell)
      if i == 0 or rnn_cell_size[i] != rnn_cell_size[i - 1]:
        cell = contrib_rnn.InputProjectionWrapper(cell, rnn_cell_size[i])
    cell = rnn.DropoutWrapper(
        cell,
        input_keep_prob=dropout_keep_prob)
    cells.append(cell)
  return rnn.MultiRNNCell(cells)
def rnn_cell ( rnn_cell_size , dropout_keep_prob , residual , is_training = True ) : dropout_keep_prob = dropout_keep_prob if is_training else 1.0 cells = [ ] for i in range ( len ( rnn_cell_size ) ) : cell = contrib_rnn . LSTMBlockCell ( rnn_cell_size [ i ] ) if residual : cell = rnn . ResidualWrapper ( cell ) if i == 0 or rnn_cell_size [ i ] != rnn_cell_size [ i - 1 ] : cell = contrib_rnn . InputProjectionWrapper ( cell , rnn_cell_size [ i ] ) cell = rnn . DropoutWrapper ( cell , input_keep_prob = dropout_keep_prob ) cells . append ( cell ) return rnn . MultiRNNCell ( cells )