(self, inputs, state)
return h, new_state
Long short-term memory cell (LSTM).
Long short-term memory cell (LSTM).
Long short - term memory cell ( LSTM ) .
def call(self, inputs, state):
    """Long short-term memory cell (LSTM)."""
    if len(state) != 2:
      raise ValueError("Expecting state to be a tuple with length 2.")

    if self._use_peephole:
      wci = self._w_i_diag
      wcf = self._w_f_diag
      wco = self._w_o_diag
    else:
      wci = wcf = wco = tf.zeros([self._num_units], dtype=self.dtype)

    (cs_prev, h_prev) = state
    (_, cs, _, _, _, _, h) = _lstm_block_cell(
        inputs,
        cs_prev,
        h_prev,
        self._kernel,
        self._bias,
        wci=wci,
        wcf=wcf,
        wco=wco,
        forget_bias=self._forget_bias,
        cell_clip=self._cell_clip,
        use_peephole=self._use_peephole)

    new_state = rnn_cell.LSTMStateTuple(cs, h)
    return h, new_state
def call ( self , inputs , state ) : if len ( state ) != 2 : raise ValueError ( "Expecting state to be a tuple with length 2." ) if self . _use_peephole : wci = self . _w_i_diag wcf = self . _w_f_diag wco = self . _w_o_diag else : wci = wcf = wco = tf . zeros ( [ self . _num_units ] , dtype = self . dtype ) ( cs_prev , h_prev ) = state ( _ , cs , _ , _ , _ , _ , h ) = _lstm_block_cell ( inputs , cs_prev , h_prev , self . _kernel , self . _bias , wci = wci , wcf = wcf , wco = wco , forget_bias = self . _forget_bias , cell_clip = self . _cell_clip , use_peephole = self . _use_peephole ) new_state = rnn_cell . LSTMStateTuple ( cs , h ) return h , new_state