tst_conv.py 文件源码

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

项目:SeqMatchSeq 作者: pcgreat 项目源码 文件源码
def forward(self, input):
        weights = self.weight.view(self.inp, self.outp * self.kw)  # weights applied to all
        bias = self.bias
        nOutputFrame = int((input.size(0) - self.kw) / self.dw + 1)

        output = Variable(torch.FloatTensor(nOutputFrame, self.outp))
        for i in range(input.size(0)):  # do -- for each sequence element
            element = input[i]  # ; -- features of ith sequence element
            output[i] = torch.dot(element, weights) + bias
        return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号