mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
* [Feature] add focal loss * fix the bug of 'non' reduction type * refine the implementation * add class_weight and ignore_index; support different alpha values for different classes * fixed some bugs * fix bugs * add comments * modify test * Update mmseg/models/losses/focal_loss.py Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn> * update test_focal_loss.py * modified the implementation * Update mmseg/models/losses/focal_loss.py Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com> * update focal_loss.py Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn> Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
16 lines
628 B
Python
16 lines
628 B
Python
# Copyright (c) OpenMMLab. All rights reserved.
|
|
from .accuracy import Accuracy, accuracy
|
|
from .cross_entropy_loss import (CrossEntropyLoss, binary_cross_entropy,
|
|
cross_entropy, mask_cross_entropy)
|
|
from .dice_loss import DiceLoss
|
|
from .focal_loss import FocalLoss
|
|
from .lovasz_loss import LovaszLoss
|
|
from .utils import reduce_loss, weight_reduce_loss, weighted_loss
|
|
|
|
__all__ = [
|
|
'accuracy', 'Accuracy', 'cross_entropy', 'binary_cross_entropy',
|
|
'mask_cross_entropy', 'CrossEntropyLoss', 'reduce_loss',
|
|
'weight_reduce_loss', 'weighted_loss', 'LovaszLoss', 'DiceLoss',
|
|
'FocalLoss'
|
|
]
|