本文整理汇总了Python中skip_thoughts.ops.gru_cell.LayerNormGRUCell方法的典型用法代码示例。如果您正苦于以下问题:Python gru_cell.LayerNormGRUCell方法的具体用法?Python gru_cell.LayerNormGRUCell怎么用?Python gru_cell.LayerNormGRUCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skip_thoughts.ops.gru_cell
的用法示例。
在下文中一共展示了gru_cell.LayerNormGRUCell方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _initialize_gru_cell
# 需要导入模块: from skip_thoughts.ops import gru_cell [as 别名]
# 或者: from skip_thoughts.ops.gru_cell import LayerNormGRUCell [as 别名]
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 skip-thoughts 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
skip-thoughts paper.
"""
return gru_cell.LayerNormGRUCell(
num_units,
w_initializer=self.uniform_initializer,
u_initializer=random_orthonormal_initializer,
b_initializer=tf.constant_initializer(0.0))