Loss Functions

synopsis

Supported loss functions to use with NPU API for training.

npu.loss.CTCLoss = 'CTCLoss'
npu.loss.CosineEmbeddingLoss = 'CosineEmbeddingLoss'

Pytorch equivalent Cosine Embedding Loss

npu.loss.KLDivLoss = 'KLDivLoss'

Killback-Leibler divergence loss

npu.loss.L1Loss = 'L1Loss'
npu.loss.MSELoss = 'MSELoss'
npu.loss.NLLLoss = 'NLLLoss'
npu.loss.SigmoidBCELoss = 'SigmoidBCELoss'

Binary Cross Entropy Loss

npu.loss.SmoothL1Loss = 'SmoothL1Loss'

Huber Loss or smooth L1 loss

npu.loss.SoftmaxCrossEntropyLoss = 'SoftmaxCrossEntropyLoss'

Softmax + CE Loss together

npu.loss.SparseCrossEntropyLoss = 'SparseCrossEntropyLoss'