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

feat(diff/zero_order): add OOP API for zero-order differentiation #125

Merged
merged 6 commits into from
Jan 11, 2023

Conversation

XuehaiPan
Copy link
Member

@XuehaiPan XuehaiPan commented Dec 5, 2022

Description

Describe your changes in detail.

Add OOP API for zero-order differentiation.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of example)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format. (required)
  • I have checked the code using make lint. (required)
  • I have ensured make test pass. (required)

@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2022

Codecov Report

Base: 69.52% // Head: 70.08% // Increases project coverage by +0.55% 🎉

Coverage data is based on head (dbe9c1b) compared to base (03686dc).
Patch coverage: 94.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
+ Coverage   69.52%   70.08%   +0.55%     
==========================================
  Files          69       71       +2     
  Lines        2901     2948      +47     
==========================================
+ Hits         2017     2066      +49     
+ Misses        884      882       -2     
Flag Coverage Δ
unittests 70.08% <94.00%> (+0.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
torchopt/diff/zero_order/nn/module.py 91.89% <91.89%> (ø)
torchopt/diff/__init__.py 100.00% <100.00%> (ø)
torchopt/diff/implicit/nn/__init__.py 100.00% <100.00%> (ø)
torchopt/diff/zero_order/__init__.py 100.00% <100.00%> (+9.09%) ⬆️
torchopt/diff/zero_order/nn/__init__.py 100.00% <100.00%> (ø)
torchopt/nn/__init__.py 100.00% <100.00%> (ø)
torchopt/diff/zero_order/decorator.py 96.81% <0.00%> (+1.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@XuehaiPan XuehaiPan changed the title [POC] feat(diff/zero_order): add OOP API for zero-order gradient feat(diff/zero_order): add OOP API for zero-order differentiation Dec 29, 2022
@XuehaiPan XuehaiPan marked this pull request as ready for review December 29, 2022 09:16
@XuehaiPan XuehaiPan merged commit 381f4d1 into metaopt:main Jan 11, 2023
@XuehaiPan XuehaiPan deleted the zero-order-oop branch January 11, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature New feature pytorch Something PyTorch related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants