-
Notifications
You must be signed in to change notification settings - Fork 769
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
doc(): add IPU dy2static related docs. #4932
Merged
qili93
merged 8 commits into
PaddlePaddle:develop
from
graphcore:ipu_commit/dy2static_ipu_update
Jul 7, 2022
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
367fbb8
doc(): add IPU dy2static related docs.
czr-gc d71dcc7
fix(): fix comments.
czr-gc 394ae15
fix(): add int type doc for reduction.
czr-gc 06c02ac
fix(): fix typo.
czr-gc 07be2aa
fix(): fix order.
czr-gc e383a16
fix(): fix comments.
czr-gc a21ff85
fix(): adjust mean and sum in identity_loss.
czr-gc 93e6ac3
move move API to paddle.incubate.identity_loss
gglin001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. _cn_api_fluid_layers_identity_loss: | ||
|
||
identity_loss | ||
------------------------------- | ||
|
||
.. py:function:: paddle.fluid.layers.identity_loss(x, reduction='none') | ||
|
||
|
||
用于在IPU动态图转静态图功能中标记网络的损失值,从而能够在IPU上为网络添加反向计算过程。该OP以网络的损失值作为输入,并对输入做reduction: | ||
|
||
当 `reduction` 为 `none` 时,直接返回最原始的 `Out` 结果。 | ||
|
||
当 `reduction` 为 `mean` 时,最终的输出结果为: | ||
|
||
.. math:: | ||
Out = MEAN(Out) | ||
|
||
当 `reduction` 为 `sum` 时,最终的输出结果为: | ||
|
||
.. math:: | ||
Out = SUM(Out) | ||
|
||
参数 | ||
:::::::::::: | ||
|
||
- **x** (Variable) - 输入张量。维度为[N, \*]的多维Tensor,其中N是批大小,\*表示任何数量的附加维度。数据类型在CPU上为float32或float64,在IPU上为float16或float32。 | ||
- **reduction** (str|int,可选) - 指定应用于输出结果的计算方式,可选的string值有: ``'mean'``, ``'sum'``, ``'none'`` ,对应的int值分别为0,1,2 。默认为 ``'none'``,直接返回输入loss的值;设置为 ``'mean'`` 时,返回输入loss的均值;设置为 ``'sum'`` 时,计算输入loss的总和。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 已删除 |
||
|
||
返回 | ||
:::::::::::: | ||
Variable,根据 `reduction` 返回网络损失值的计算结果。 | ||
|
||
代码示例 | ||
:::::::::::: | ||
|
||
COPY-FROM: paddle.fluid.layers.identity_loss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
请删除 “该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.
已改为
算子以网络的损失值作为输入
.