box_utils.py 文件源码

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

项目:ssd.pytorch 作者: amdegroot 项目源码 文件源码
def log_sum_exp(x):
    """Utility function for computing log_sum_exp while determining
    This will be used to determine unaveraged confidence loss across
    all examples in a batch.
    Args:
        x (Variable(tensor)): conf_preds from conf layers
    """
    x_max = x.data.max()
    return torch.log(torch.sum(torch.exp(x-x_max), 1, keepdim=True)) + x_max


# Original author: Francisco Massa:
# https://github.com/fmassa/object-detection.torch
# Ported to PyTorch by Max deGroot (02/01/2017)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号