Skip to content

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

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

wcrzlh
Copy link
Collaborator

@wcrzlh wcrzlh commented Jun 12, 2023

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

@wcrzlh wcrzlh force-pushed the swin_trans branch 2 times, most recently from d8ca946 to f02a483 Compare June 15, 2023 07:01
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)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些算子统一看下有没有函数式接口的,有就替换下

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wcrzlh finished???

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finished

@wcrzlh wcrzlh force-pushed the swin_trans branch 2 times, most recently from a019783 to 9e74398 Compare June 29, 2023 03:50
@wcrzlh wcrzlh requested review from vigo999 and geniuspatrick June 29, 2023 06:09
@geniuspatrick
Copy link
Contributor

please add some unit tests

@wcrzlh wcrzlh force-pushed the swin_trans branch 2 times, most recently from 6c316a3 to 899b878 Compare July 4, 2023 09:12
@wcrzlh
Copy link
Collaborator Author

wcrzlh commented Jul 5, 2023

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))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clip to [eps, 1.]?

@geniuspatrick geniuspatrick merged commit e32643a into mindspore-lab:main Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants