pytorch focalloss

  import torch

    gamma = torch.ones_like(focal_weight).cuda()
            gamma[focal_weight > 0.5] = 0.4
            gamma[focal_weight < 0.5] = 2.2

            focal_weight = alpha_factor * torch.pow(focal_weight, gamma)
发布了2853 篇原创文章 · 获赞 1112 · 访问量 581万+

猜你喜欢

转载自blog.csdn.net/jacke121/article/details/105578908
今日推荐