-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add softmax version to focal_loss #6544
Conversation
for more information, see https://pre-commit.ci
…nto add-softmax
DCO Remediation Commit for Qingpeng Li <qingpeng9802@gmail.com> I, Qingpeng Li <qingpeng9802@gmail.com>, hereby add my Signed-off-by to this commit: cb5ed04 I, Qingpeng Li <qingpeng9802@gmail.com>, hereby add my Signed-off-by to this commit: 78eebaf Signed-off-by: Qingpeng Li <qingpeng9802@gmail.com>
For further reference, the implementation reference (pytorch/detectron) has been visualized above. @wyli Please help review the current implementation. Some unit tests will be added after the review. |
thanks @qingpeng9802, it looks good to me, one minor thing is that if we assume |
DCO Remediation Commit for Qingpeng Li <qingpeng9802@gmail.com> I, Qingpeng Li <qingpeng9802@gmail.com>, hereby add my Signed-off-by to this commit: 5db9e58 Signed-off-by: Qingpeng Li <qingpeng9802@gmail.com>
for more information, see https://pre-commit.ci
/black |
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
loss: torch.Tensor = torch.where(target>0.5, - (1 - input_ls.exp()).pow(gamma) * input_ls, 0) and input_ls[target>0.5]=0.
loss: torch.Tensor = - (1 - input_ls.exp()).pow(gamma) * input_ls are benchmarked. Both are significantly slower than the original one. It looks like |
sure, thanks for looking into these @qingpeng9802! |
Signed-off-by: Qingpeng Li <qingpeng9802@gmail.com>
for more information, see https://pre-commit.ci
/black |
Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
/build |
Fixes #6510 .
Description
Add softmax version to Focal loss
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.