我实现了标签 - 平滑,AmsoftMax,部分-FC,焦点损失,双尾部损失,三重损失,giou/diou/diou/diou/diou/diou/ciou-loss/func,affinity-loss,pc_softmax_cross_cross_entropy,ohem-loss,ohem-loss,ohemax,softmax,基于线路硬矿山矿业损失),大矿床损失),大型margin-softmax(bmargin-softmax( lovasz-softmax-loss和Dice-loss(均已普遍的软骰子丢失和批处理软骰子损失)。也许这对我将来的工作很有用。
还试图实施Swish,Hard-Swish(Hswish)和Mish激活功能。
此外,添加了基于CUDA的一hot函数(支持标签平滑)。
新添加了“指数移动平均值(EMA)”运算符。
添加卷积OPS,例如COORD-CONV2D和DYAMIC-CONV2D(DY-CONV2D)。
一些操作员使用Pytorch Cuda扩展程序实施,因此您需要首先对其进行编译:
$ python -m pip install .
安装后,现在您可以拿起所需的东西,并使用损失或操作,例如其中一个:
from pytorch_loss import SwishV1 , SwishV2 , SwishV3
from pytorch_loss import HSwishV1 , HSwishV2 , HSwishV3
from pytorch_loss import MishV1 , MishV2 , MishV3
from pytorch_loss import convert_to_one_hot , convert_to_one_hot_cu , OnehotEncoder
from pytorch_loss import EMA
from pytorch_loss import TripletLoss
from pytorch_loss import SoftDiceLossV1 , SoftDiceLossV2 , SoftDiceLossV3
from pytorch_loss import PCSoftmaxCrossEntropyV1 , PCSoftmaxCrossEntropyV2
from pytorch_loss import LargeMarginSoftmaxV1 , LargeMarginSoftmaxV2 , LargeMarginSoftmaxV3
from pytorch_loss import LabelSmoothSoftmaxCEV1 , LabelSmoothSoftmaxCEV2 , LabelSmoothSoftmaxCEV3
from pytorch_loss import GIOULoss , DIOULoss , CIOULoss
from pytorch_loss import iou_func , giou_func , diou_func , ciou_func
from pytorch_loss import FocalLossV1 , FocalLossV2 , FocalLossV3
from pytorch_loss import Dual_Focal_loss
from pytorch_loss import GeneralizedSoftDiceLoss , BatchSoftDiceLoss
from pytorch_loss import AMSoftmax
from pytorch_loss import AffinityFieldLoss , AffinityLoss
from pytorch_loss import OhemCELoss , OhemLargeMarginLoss
from pytorch_loss import LovaszSoftmaxV1 , LovaszSoftmaxV3
from pytorch_loss import TaylorCrossEntropyLossV1 , TaylorCrossEntropyLossV3
from pytorch_loss import InfoNceDist
from pytorch_loss import PartialFCAMSoftmax
from pytorch_loss import TaylorSoftmaxV1 , TaylorSoftmaxV3
from pytorch_loss import LogTaylorSoftmaxV1 , LogTaylorSoftmaxV3
from pytorch_loss import CoordConv2d , DY_Conv2d Note that some losses or ops have 3 versions, like LabelSmoothSoftmaxCEV1 , LabelSmoothSoftmaxCEV2 , LabelSmoothSoftmaxCEV3 , here V1 means the implementation with pure pytorch ops and use torch.autograd for backward computation, V2 means implementation with pure pytorch ops but use self-derived formula for backward computation, and V3 means implementation with cuda 扩大。一般而言, V3 OPS的内存效率更快,更有效,因为我试图挤压一个CUDA内核功能,在大多数情况下,与Pytorch Ops的组合相比,它的开销少。
对于那些碰巧找到此存储库的人,如果您在我的代码中看到错误,请随时打开一个问题以纠正我。