Skip to content
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

【PPSCI Doc No.75, 77-85】 #703

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Dec 16, 2023

PR types

Others

PR changes

Docs

Describe

No.75, 77-85

Copy link

paddle-bot bot commented Dec 16, 2023

Thanks for your contribution!

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

感谢大佬提交PR

Comment on lines 30 to 49
$$
L = f(x, y)
$$

$$
\mathbf{x}, \mathbf{y} \in \mathcal{R}^{N}
$$

when `reduction` is set to "mean"

$$
L = MEAN \left[ f(x, y) \right]
$$

when `reduction` is set to "sum"

$$
L = SUM \left[ f(x, y) \right]
$$

Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可以删掉,因为 FunctionalLoss 不需要 reduction这个参数

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

>>> result = loss(output_dict, label_dict, weight_dict)
>>> print(result)
Tensor(shape=[], dtype=float32, place=Place(gpu:0), stop_gradient=True,
17.89600182)
"""

def __init__(
Copy link
Collaborator

Choose a reason for hiding this comment

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

可以把下方的reduction这个参数删除

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

$$
L = SUM \left[ f(x, y) \right]
$$

Args:
loss_expr (Callable): expression of loss calculation.
reduction (Literal["mean", "sum"], optional): Reduction method. Defaults to "mean".
Copy link
Collaborator

Choose a reason for hiding this comment

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

可以删除reduction参数

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已删除

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

函数f处的参数加粗一下就行了,辛苦

ppsci/loss/func.py Outdated Show resolved Hide resolved
Co-authored-by: HydrogenSulfate <490868991@qq.com>
Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

LGTM

@HydrogenSulfate HydrogenSulfate merged commit 5e78c13 into PaddlePaddle:develop Dec 21, 2023
3 checks passed
@NKNaN NKNaN deleted the docs-complete2 branch December 26, 2023 14:57
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* update docs

* update func

* Update ppsci/loss/func.py

Co-authored-by: HydrogenSulfate <490868991@qq.com>

---------

Co-authored-by: HydrogenSulfate <490868991@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants