ran_cell.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:tf-ran-cell 作者: indiejoseph 项目源码 文件源码
def __call__(self, inputs, state, scope=None):
    with _checked_scope(self, scope or "ran_cell", reuse=self._reuse):
      with vs.variable_scope("gates"):
        value = tf.nn.sigmoid(linear([state, inputs], 2 * self._num_units, True, normalize=self._normalize))
        i, f = array_ops.split(value=value, num_or_size_splits=2, axis=1)

      with vs.variable_scope("candidate"):
        c = linear([inputs], self._num_units, True, normalize=self._normalize)

      new_c = i * c + f * state
      new_h = self._activation(c)

    return new_h, new_c
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号