-
Notifications
You must be signed in to change notification settings - Fork 271
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
【Hackathon No.26】 #27
Conversation
PR 格式检查通过,你的PR 将接受Paddle 专家以及开源社区的review,请及时关注PR 动态 |
reviewing |
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.
paddle.nn.TripletMarginLoss 是三元损失函数,其针对 anchor 和正负对计算 P 范数距离下的三元损失,从而获得损失值。 | ||
|
||
## 3、意义 | ||
使paddle支持更多的损失函数 |
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.
意义可以进一步具体化,比如增加APIxx
,实现xx的功能。
无此功能,但可以在python层通过调用基础api的形式实现。 | ||
|
||
# 三、业内方案调研 | ||
torch有此api,是在c++层实现的,不过调用的基础op飞桨均有实现 |
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.
可以补充完整 torch api 的实现方式,包含关键代码和核心逻辑,从而明确实现原理
使paddle支持更多的损失函数 | ||
|
||
# 二、飞桨现状 | ||
无此功能,但可以在python层通过调用基础api的形式实现。 |
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.
可以进一步参考 paddle 其他损失函数 API 实现方式,并对关键逻辑、是否可以复用进行描述
本方案计划在python层开发,不涉及底层c++,故减轻了日后的编译开销,计算全部在c++层,不会损失性能。 | ||
且与torch的api一致,方便用户无缝迁移到paddle。 |
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.
对比分析部分可以阐述不同方案(torch,paddle,numpy,tensorflow等)对于参数设计差异,对参数维度支持差异,特殊场景支持差异等。
核心功能放在functional中,在nn中暴露出来,方便用户调用,与其它api一致 | ||
|
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.
测试用例需要进一步具体化
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.
请按照评审意见进行修改
你的PR有最新反馈,请及时修改。 |
#31 merged, this PR is closed, thanks for your contribution! |
为 Paddle 新增 TripletMarginLoss 损失函数API rfc