utils_subword_rnn.py 文件源码

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

项目:vsmlib 作者: undertherain 项目源码 文件源码
def __call__(self, cur_word):
        # Given the current word ID, predict the next word.
        x = self.embed(cur_word)
        # dropout. ref: https://docs.chainer.org/en/stable/reference/generated/chainer.functions.dropout.html?highlight=dropout
        with chainer.using_config('train', True):
            x = F.dropout(x, self.dropout)
        h = self.mid(x)
        with chainer.using_config('train', True):
            h = F.dropout(h, self.dropout)
        y = self.out(h)
        return y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号