resnet_mil.py 文件源码

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

项目:MIL.pytorch 作者: gujiuxiang 项目源码 文件源码
def forward(self, img, att_size=14):
        x0 = self.conv(img)
        x = self.pool_mil(x0)
        x = x.squeeze(2).squeeze(2)
        x = self.l1(x)
        x1 = torch.add(torch.mul(x.view(x.size(0), 1000, -1), -1), 1)
        cumprod = torch.cumprod(x1, 2)
        out = torch.max(x, torch.add(torch.mul(cumprod[:, :, -1], -1), 1))
        return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号