-
Notifications
You must be signed in to change notification settings - Fork 148
feat: add jsd loss and asymmetric loss #682
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
Conversation
d8ca946
to
f02a483
Compare
mindcv/loss/asymmetric.py
Outdated
if self.clip > 0: | ||
xs_neg = ops.clip_by_value(xs_neg + self.clip, clip_value_max=Tensor(1.0)) | ||
|
||
los_pos = labels * ops.Log()(ops.clip_by_value(xs_pos, clip_value_min=Tensor(self.eps))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些算子统一看下有没有函数式接口的,有就替换下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wcrzlh finished???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finished
a019783
to
9e74398
Compare
please add some unit tests |
6c316a3
to
899b878
Compare
added |
xs_neg = 1 - x_sigmoid | ||
|
||
if self.clip > 0: | ||
xs_neg = ops.clip_by_value(xs_neg + self.clip, clip_value_max=Tensor(1.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clip to [eps, 1.]?
Thank you for your contribution to the MindCV repo.
Before submitting this PR, please make sure:
Motivation
Jsd loss and asymmetric loss are added.
Test Plan
(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)
Related Issues and PRs
Related issue: #621