-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Switch from sin(x) to exp(x) as the target function in polynomial_autograd #3597
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
Switch from sin(x) to exp(x) as the target function in polynomial_autograd #3597
Conversation
…in(x) as the function to be learned
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3597
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 44aac34 with merge base d7a5681 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @leomilano! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
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.
Thanks!
@leomilano can you please fix lintrunner? Happy to merge after that |
@svekars Will do, shortly |
Hi, @svekars , I just did - the latest commit passes "lintrunner -m" locally - Thanks much! |
…ograd (pytorch#3597) Fixes pytorch#3596 This PR branch uses 'exp(x)' instead of 'sin(x)' as the 'y' (target) variable. The reason for this is faster and clearer convergence, since exp(x) is well approximated by a Taylor expansion around the origin. Also, all the derivatives are exp(0)=1, so the polynomial coefficients are trivially '1/n! '(for the 'n-th' term). I am also improving the information output to the user inside the optimization loop. Finally, I am making the top doc string a raw string, to avoid a python3 warning about it. cc @albanD @jbschlosser --------- Co-authored-by: Svetlana Karslioglu <[email protected]>
…ograd (pytorch#3597) Fixes pytorch#3596 This PR branch uses 'exp(x)' instead of 'sin(x)' as the 'y' (target) variable. The reason for this is faster and clearer convergence, since exp(x) is well approximated by a Taylor expansion around the origin. Also, all the derivatives are exp(0)=1, so the polynomial coefficients are trivially '1/n! '(for the 'n-th' term). I am also improving the information output to the user inside the optimization loop. Finally, I am making the top doc string a raw string, to avoid a python3 warning about it. cc @albanD @jbschlosser --------- Co-authored-by: Svetlana Karslioglu <[email protected]>
I have some doubts for this change. I think the updated file actually causes inconsistency.
Thus this example source should be reverted to sin(x) unless a comprehensive update to the whole tutorial page. |
Good points, @konjac . Sorry about your point 1, I didn't notice. I could quickly address that, but I think point 2 is harder to address, I hadn't noticed the disconnect with the rest of the tutorial. The other changes in the PR are minor improvements and I see no reason to revert those. How about this proposal for a new PR: (a) move back to My motivation for the change was that it wasn't clear to me that this thing was converging, so I made the local change I wound up submitting. Anyways, if this sounds like a good idea, please let me know whether I should open a new issue or refer to this (closed) issue (would we need to reopen it?) Thanks so much! - Leo |
Fixes #3596
Description
This PR branch uses 'exp(x)' instead of 'sin(x)' as the 'y' (target) variable. The reason for this is faster and clearer convergence, since exp(x) is well approximated by a Taylor expansion around the origin. Also, all the derivatives are exp(0)=1, so the polynomial coefficients are trivially '1/n! '(for the 'n-th' term).
I am also improving the information output to the user inside the optimization loop.
Finally, I am making the top doc string a raw string, to avoid a python3 warning about it.
Checklist
cc @albanD @jbschlosser