-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Fixes] Poisson NLL Loss to align with PyTorch and TensorFlow #56824
Conversation
…ions This commit updates the condition for adding the Stirling approximation term in Poisson NLL Loss to align with how PyTorch and TensorFlow handle it. The condition is changed from 'label <= 1' to 'label > 1' for adding the Stirling term, making the behavior consistent across frameworks.
你的PR提交成功,感谢你对开源项目的贡献! |
✅ This PR's description meets the template requirements! |
Closes #56824 |
Please fix the PR-CI-Codestyle-Check |
@LyndonKong Please help review this PR |
Please use pre-commit to pass the codestyle check. |
Don't know why but pre-commit is not detecting my docker image. To be fair the whole compiling from source has been a struggle to setup at my end. Do you guys have an more in-depth guide on how to run docker once I am done with the installation because when I run it using |
The pre-commit tool is installed in your git repo, as shown in this document. As for compiling, running unit testing can be more simple. I suggest to follow the steps in operator development guideline. |
Hey @LyndonKong , can you tell me why pre-commit is not getting detected ? ```py
λ aja /paddle {issue_!} pre-commit install
pre-commit installed at /paddle/.git/hooks/pre-commit
λ aja /paddle {issue_!} git commit
An error has occurred: InvalidManifestError:
==> File /root/.cache/pre-commit/repoKjsZ6G/.pre-commit-hooks.yaml
==> At Hook(id='forbid-submodules')
==> At key: language
=====> Expected one of docker, docker_image, golang, node, pcre, pygrep, python, python_venv, ruby, rust, script, swift, system but got: 'fail'
Check the log at /root/.cache/pre-commit/pre-commit.log
λ aja /paddle {issue_!} pre-commit run
An error has occurred: InvalidManifestError:
==> File /root/.cache/pre-commit/repoKjsZ6G/.pre-commit-hooks.yaml
==> At Hook(id='forbid-submodules')
==> At key: language
=====> Expected one of docker, docker_image, golang, node, pcre, pygrep, python, python_venv, ruby, rust, script, swift, system but got: 'fail'
Check the log at /root/.cache/pre-commit/pre-commit.log
λ aja /paddle {issue_!} git status
On branch issue_!
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: python/paddle/nn/functional/loss.py
modified: test/legacy_test/test_poisson_nll_loss.py
λ aja /paddle {issue_!} python
Python 3.7.12 (default, Sep 10 2021, 00:21:48)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle; paddle.utils.run_check()
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
Running verify PaddlePaddle program ...
I0905 11:39:04.038331 18344 program_interpreter.cc:136] New Executor is Running.
I0905 11:39:04.048725 18344 interpreter_util.cc:602] Standalone Executor is Used.
PaddlePaddle works well on 1 CPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
>>>
|
I had to delete my current setup and reset everything when trying to compile to from source but now pre-commit has been working correctly! : |
PR types
Others
PR changes
Others
Description
This commit updates the condition for adding the Stirling approximation term in Poisson NLL Loss to align with how PyTorch and TensorFlow handle it. The condition is changed from 'label <= 1' to 'label > 1' for adding the Stirling term, making the behavior consistent across frameworks.