(self, inputs, state, scope='convLSTM')
Long short-term memory cell (LSTM).
Long short-term memory cell (LSTM).
Long short - term memory cell ( LSTM ) .
def __call__(self, inputs, state, scope='convLSTM'):
        """Long short-term memory cell (LSTM)."""
        with tf.variable_scope(scope or type(self).__name__):  # "BasicLSTMCell"
            # Parameters of gates are concatenated into one multiply for efficiency.
            if self._state_is_tuple:
                c, h = state
            else:
                c, h = tf.split(state, 2, 3)
            concat = _conv_linear([inputs, h], self.filter_size, self.num_features * 4, True)

            # i = input_gate, j = new_input, f = forget_gate, o = output_gate
            i, j, f, o = tf.split(concat, 4, 3)

            new_c = (c * tf.nn.sigmoid(f + self._forget_bias) + tf.nn.sigmoid(i) *
                     self._activation(j))
            new_h = self._activation(new_c) * tf.nn.sigmoid(o)

            if self._state_is_tuple:
                new_state = LSTMStateTuple(new_c, new_h)
            else:
                new_state = tf.concat([new_c, new_h], 3)
            return new_h, new_state
def __call__ ( self , inputs , state , scope = 'convLSTM' ) : with tf . variable_scope ( scope or type ( self ) . __name__ ) : # "BasicLSTMCell" # Parameters of gates are concatenated into one multiply for efficiency. if self . _state_is_tuple : c , h = state else : c , h = tf . split ( state , 2 , 3 ) concat = _conv_linear ( [ inputs , h ] , self . filter_size , self . num_features * 4 , True ) # i = input_gate, j = new_input, f = forget_gate, o = output_gate i , j , f , o = tf . split ( concat , 4 , 3 ) new_c = ( c * tf . nn . sigmoid ( f + self . _forget_bias ) + tf . nn . sigmoid ( i ) * self . _activation ( j ) ) new_h = self . _activation ( new_c ) * tf . nn . sigmoid ( o ) if self . _state_is_tuple : new_state = LSTMStateTuple ( new_c , new_h ) else : new_state = tf . concat ( [ new_c , new_h ] , 3 ) return new_h , new_state