-
Notifications
You must be signed in to change notification settings - Fork 182
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
Conversation
Thanks for your contribution! |
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
ppsci/loss/func.py
Outdated
$$ | ||
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] | ||
$$ | ||
|
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.
这里可以删掉,因为 FunctionalLoss 不需要 reduction这个参数
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.
已删除
>>> 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__( |
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.
可以把下方的reduction这个参数删除
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.
已删除
ppsci/loss/func.py
Outdated
$$ | ||
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". |
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.
可以删除reduction参数
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.
函数f处的参数加粗一下就行了,辛苦
Co-authored-by: HydrogenSulfate <490868991@qq.com>
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.
LGTM
* update docs * update func * Update ppsci/loss/func.py Co-authored-by: HydrogenSulfate <490868991@qq.com> --------- Co-authored-by: HydrogenSulfate <490868991@qq.com>
PR types
Others
PR changes
Docs
Describe
No.75, 77-85