Commit Graph

20 Commits (eef12a064b6da7e8ac36f327bd4cc65553113c65)

Author SHA1 Message Date
linfangjian.vendor 7a32d610e4 [Refactor] Refactor all registries 2022-05-10 12:15:20 +00:00
wangbin 578d4d0c42 [Fix] Fix the bug in binary_cross_entropy (#1527)
* [Fix] Fix the bug in binary_cross_entropy

 Fix the bug in binary_cross_entropy
'label.max() <= 1' should mask out ignore_index, since the ignore_index often set as 255.

* [Fix] Fix the bug in binary_cross_entropy, add comments

As the ignore_index often set as 255, so the binary class label check should mask out ignore_index.

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

* [Fix] Fix the bug in binary_cross_entropy

As the ignore_index often set as 255, so the binary class label check should mask out ignore_index.

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
Co-authored-by: MeowZheng <meowzheng@outlook.com>
2022-04-29 19:32:12 +08:00
Wang Xinjiang b5d8c7dc6c Fix potential bugs in accuracy.py (#1496) 2022-04-21 10:18:37 +08:00
Rockey 23b7cfc59d [Fix] Support single cahnnel `pred` for Binary Cross Entropy Loss (#1454)
* [Fix] Fix the bug that binary cross entropy loss doesn't support single channel input

* imcrease coverage

* modify implementation

* increase coverage

* add assert

* modify implementation

* enshollow condition judge

* fix
2022-04-14 11:26:02 +08:00
MengzhangLI cc89c8d18d [Fix] Add avg_non_ignore in cross entropy loss (#1409)
* [Fix] Add avg_non_ignore in cross entropy loss

* [Fix] Add avg_non_ignore in cross entropy loss

* add docstring

* fix ut

* fix docstring and comments

* fix

* fix bce

* fix avg_factor in BCE and add more ut

* add avg_non_ignore

* add more ut

* fix part of ut

* fix part of ut

* test avg_non_ignore would not affect ce/bce when reduction none/sum

* test avg_non_ignore would not affect ce/bce when reduction none/sum/mean

* re-organize ut

* re-organize ut

* re-organize ut

* re-organize hardcode case

* fix parts of comments

* fix another parts of comments

* fix
2022-03-30 18:32:47 +08:00
Rockey 6665b42159 [Fix] Fix the bug that when all pixels in an image is ignored, the ac… (#1336)
* [Fix] Fix the bug that when all pixels in an image is ignored, the accuracy calculation raises ZeroDivisionError

* use eps

* all close

* add ignore test

* add eps
2022-03-09 13:20:46 +08:00
Hyeokjoon Kwon 4d451a09dc [Fix] Make accuracy take into account ignore_index (#1259)
* make accuracy take into account ignore_index

* add UT for accuracy
2022-02-15 00:39:59 +08:00
KangBK0120 3d58196e62 [Fix] Remove unexist arg in docstring #1106 2021-12-06 20:03:25 +08:00
Rockey 07cd6c98e0 [Feature] Add focal loss (#1024)
* [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>
2021-12-03 00:18:40 -08:00
Junjun2016 67f1420472 [Enhancement] Add codespell pre-commit hook and fix typos (#920)
* add codespell pre-commit hook and fix typos

* Update mmseg/models/decode_heads/dpt_head.py

* Update mmseg/models/backbones/vit.py

* Update mmseg/models/backbones/vit.py

* fix typos

* skip formating typo

* deprecate formating

* skip ipynb

* unstage ipynb changes

* unstage ipynb changes

* fix typos in ipynb

* unstage ipynb changes
2021-10-13 06:21:17 -07:00
MengzhangLI 0fd3972c41 [Feature] Support multiple losses during training (#818)
* multiple losses

* fix lint error

* fix typos

* fix typos

* Adding Attribute

* Fixing loss_ prefix

* Fixing loss_ prefix

* Fixing loss_ prefix

* Add Same

* loss_name must has 'loss_' prefix

* Fix unittest

* Fix unittest

* Fix unittest

* Update mmseg/models/decode_heads/decode_head.py

Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-09-24 15:08:28 +08:00
Junjun2016 2fe0bddf5e [Dcos] Add header for files (#796)
* Add header for files

* Delete header in config files
2021-08-16 23:16:55 -07:00
Ziyi Wu 771ca7d3e0 [Enhance] Support reading class_weight from file in loss functions to help MMDet3D (#513)
* support reading class_weight from file in loss function

* add unit test of loss with class_weight from file

* minor fix

* move get_class_weight to utils
2021-04-29 01:04:15 -07:00
Jerry Jiarui XU d283ca6fea [Improvement] Add more CI (#460)
* add more CI

* fix missing

* remove python-version

* fixed acc
2021-04-08 19:29:00 -07:00
lizz bbb9f074f6 Fix typo: upsampe_cfg -> upsample_cfg (#449)
* Fix typo: upsampe_cfg -> upsample_cfg

Signed-off-by: lizz <lizz@sensetime.com>

* convoluton -> convolution

Signed-off-by: lizz <lizz@sensetime.com>

* more

Signed-off-by: lizz <lizz@sensetime.com>

* ok

Signed-off-by: lizz <lizz@sensetime.com>
2021-03-30 09:51:38 -07:00
谢昕辰 71be1c2793 [Bug fixed]Fix dice_loss errors (#417)
* fix training bugs

* fix unitest error

* fix error in num_classes==2 case

* delete comments
2021-03-29 09:49:54 -07:00
谢昕辰 a3b523e3fd dice loss (#396)
* dice loss

* format code, add docstring and calculate denominator without valid_mask

* minor change

* restore
2021-03-10 18:32:37 -08:00
yamengxi c8bbd3fa95 [New Feature]add lovasz loss (#351)
* add lovasz loss

* Modify as comments

* Modify paper url

* add unittest and remove Var

* impove unittest
2021-01-18 19:05:30 -08:00
Jerry Jiarui XU ffcdfd36d0 [Enhancement] Support ignore_index for sigmoid BCE (#210)
* [Enhancement] Add args check for ignore_index

* Support ignore_index
2020-11-17 16:14:03 +08:00
Jiarui XU b2724da80b init commit 2020-07-10 02:39:01 +08:00