-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add focal loss #1024
[Feature] Add focal loss #1024
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1024 +/- ##
==========================================
- Coverage 89.74% 89.53% -0.21%
==========================================
Files 121 122 +1
Lines 6828 6931 +103
Branches 1139 1156 +17
==========================================
+ Hits 6128 6206 +78
- Misses 496 519 +23
- Partials 204 206 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @RockeyCoss |
Besides, some lines are not covered by unittests. |
|
@RockeyCoss It seems like some lines are not covered by unit test. Do we need to add unit test? |
Those codes need cuda to run, so it's not possible to test them. However, I have tested them with cuda available enviroment and the test_same() in unitests tests if the code will produce the same results when running in cuda available enviroment and cuda unavailable environment. |
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
Co-authored-by: Jerry Jiarui XU <xvjiarui0826@gmail.com>
* [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>
Hello @Zihang-Wei ! Did you install mmcv-full? By the way, we would appreciate it if you could report this problem in the issue. Because by doing this, the problem can be viewed by more people. |
However since inside VScode, the mmcv package is inside /opt/venv/packages/... therefore the callbacks won't step into the function imported from mmcv.ops |
…pen-mmlab#1024) * document cpu offloading method * address review comments Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Add focal loss
Modification
Add focal loss
Experiment Results
We can see through the experiments that: