utils_subword_rnn.py 文件源码

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

项目:vsmlib 作者: undertherain 项目源码 文件源码
def __call__(self, x, context):

        x = F.broadcast_to(x[:, None], (context.shape[0], context.shape[1]))
        x = F.reshape(x, (context.shape[0] * context.shape[1],))

        context = context.reshape((context.shape[0] * context.shape[1]))
        e = self.rnn.charRNN(context)

        loss = self.loss_func(e, x)
        reporter.report({'loss': loss}, self)
        return loss
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号