コード例 #1
0
    def _initialize_gru_cell(self, num_units, trainable):

        return gru_cell.LayerNormGRUCell(
            num_units,
            w_initializer=self.uniform_initializer,
            u_initializer=random_orthonormal_initializer,
            b_initializer=tf.constant_initializer(0.0),
            trainable=trainable)
コード例 #2
0
 def _initialize_gru_cell(self, num_units):
   """Initializes a GRU cell.
   The Variables of the GRU cell are initialized in a way that exactly matches
   the skipThoughts paper: recurrent weights are initialized from random
   orthonormal matrices and non-recurrent weights are initialized from random
   uniform matrices.
   Args:
     num_units: Number of output units.
   Returns:
     cell: An instance of RNNCell with variable initializers that match the
       skipThoughts paper.
   """
   return gru_cell.LayerNormGRUCell(
       num_units,
       w_initializer=self.uniform_initializer,
       u_initializer=random_orthonormal_initializer,
       b_initializer=tf.constant_initializer(0.0))