我實現了標籤 - 平滑,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請注意,某些損失或OPS具有3個版本,例如LabelSmoothSoftmaxCEV1 , LabelSmoothSoftmaxCEV2 , LabelSmoothSoftmaxCEV3 ,此處V1表示實現純Pytorch ops,並使用torch.autograd進行落後的計算, V2表示與純pytorch Ops實現,但使用py pytorch ops and cydorch op forder,cytorch op forder verdare verda verda verda velder,cytorch op forder verder verda velder, V3擴大。一般而言, V3 OPS的內存效率更快,更有效,因為我試圖擠壓一個CUDA內核功能,在大多數情況下,與Pytorch Ops的組合相比,它的開銷少。
對於那些碰巧找到此存儲庫的人,如果您在我的代碼中看到錯誤,請隨時打開一個問題以糾正我。