(self, inputs, state, scope=None)
return new_h, new_h
Gated recurrent unit (GRU) with nunits cells.
Gated recurrent unit (GRU) with nunits cells.
Gated recurrent unit ( GRU ) with nunits cells .
def __call__(self, inputs, state, scope=None):
    """Gated recurrent unit (GRU) with nunits cells."""
    with vs.variable_scope(scope or "gru_cell"):
      with vs.variable_scope("gates"):  # Reset gate and update gate.
        # We start with bias of 1.0 to not reset and not update.
        r, u = array_ops.split(
            value=_linear(
                [inputs, state], 2 * self._num_units, True, 1.0, scope=scope),
            num_or_size_splits=2,
            axis=1)
        r, u = sigmoid(r), sigmoid(u)
      with vs.variable_scope("candidate"):
        c = self._activation(_linear([inputs, r * state],
                                     self._num_units, True,
                                     scope=scope))
      new_h = u * state + (1 - u) * c
    return new_h, new_h
def __call__ ( self , inputs , state , scope = None ) : with vs . variable_scope ( scope or "gru_cell" ) : with vs . variable_scope ( "gates" ) : # Reset gate and update gate. # We start with bias of 1.0 to not reset and not update. r , u = array_ops . split ( value = _linear ( [ inputs , state ] , 2 * self . _num_units , True , 1.0 , scope = scope ) , num_or_size_splits = 2 , axis = 1 ) r , u = sigmoid ( r ) , sigmoid ( u ) with vs . variable_scope ( "candidate" ) : c = self . _activation ( _linear ( [ inputs , r * state ] , self . _num_units , True , scope = scope ) ) new_h = u * state + ( 1 - u ) * c return new_h , new_h