cell.py 文件源码

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

项目:DMN-tensorflow 作者: sufengniu 项目源码 文件源码
def __call__(self, inputs, state, episodic_gate, scope=None):
        """Gated recurrent unit (GRU) with nunits cells."""

        with vs.variable_scope("MGRUCell"):  # "GRUCell"
            with vs.variable_scope("Gates"):    # Reset gate and update gate.
                # We start with bias of 1.0 to not reset and not update.
                r = rnn_cell.linear([inputs, state], self._num_units, True, 1.0, scope=scope)
                r = sigmoid(r)
            with vs.variable_scope("Candidate"):
                c = tanh(rnn_cell.linear([inputs, r * state], self._num_units, True))

            new_h = tf.mul(episodic_gate, c) + tf.mul((1 - episodic_gate), state)
        return new_h, new_h
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号