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, args.dropout)
h = self.mid(x)
with chainer.using_config('train', True):
h = F.dropout(h, args.dropout)
y = self.out(h)
return y
train_word2vec_subword_chainer_input.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录