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

Add Differentiable CEM solver #329

Merged
merged 35 commits into from
Mar 23, 2023
Merged

Add Differentiable CEM solver #329

merged 35 commits into from
Mar 23, 2023

Conversation

dishank-b
Copy link
Contributor

@dishank-b dishank-b commented Oct 17, 2022

Motivation and Context

This adds a differential CEM solver to the optimizers class of Theseus. Can be used to solve control problems.
Based on https://github.com/facebookresearch/dcem

How Has This Been Tested

Passed the unit tests given.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

ToDos

  • Check with theseus_layer_test provided
  • Run with different backwards modes
  • Validate the gradients through the optimizer

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 17, 2022
@mhmukadam mhmukadam added the enhancement New feature or request label Oct 18, 2022
@dishank-b dishank-b marked this pull request as ready for review November 11, 2022 17:04
Copy link
Contributor

@bamos bamos left a comment

Choose a reason for hiding this comment

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

It looks like a nice initial version! I left a few minor comments inline to the core parts of the code and will review the notebooks in some more detail soon. And how are the tests looking?

tests/optimizer/nonlinear/test_dcem.py Outdated Show resolved Hide resolved
theseus/__init__.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
@dishank-b
Copy link
Contributor Author

dishank-b commented Mar 8, 2023

@luisenp @mhmukadam . Can you also have a look at this? I think it's ready to be merged from my side, a few other things can be done but that can be done in later PRs.

@dishank-b dishank-b removed the request for review from suddhu March 10, 2023 19:18
Copy link
Contributor

@luisenp luisenp left a comment

Choose a reason for hiding this comment

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

This looks great! Left a bunch of minor comments that should be easy to address. Thanks!

requirements/dev.txt Outdated Show resolved Hide resolved
requirements/main.txt Outdated Show resolved Hide resolved
tests/optimizer/nonlinear/test_dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
requirements/dev.txt Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
tutorials/06_DCEM.ipynb Outdated Show resolved Hide resolved
tests/optimizer/nonlinear/test_dcem.py Outdated Show resolved Hide resolved
Copy link
Contributor

@luisenp luisenp left a comment

Choose a reason for hiding this comment

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

Thanks for addressing these. Left a couple of follow up questions.

setup.py Outdated Show resolved Hide resolved
tests/test_theseus_layer.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
tests/optimizer/nonlinear/test_dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@dishank-b dishank-b left a comment

Choose a reason for hiding this comment

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

Made the changes, have a look.

Copy link
Contributor

@luisenp luisenp left a comment

Choose a reason for hiding this comment

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

LGTM! Left a couple of comments of things we can move to a separate PR. I think we could also rename some of the args/kwargs, but I'm OK with merging as is. I can take a look at this after we have a unit test in place. Thanks for your hard work on this!

theseus/optimizer/nonlinear/dcem.py Show resolved Hide resolved
tutorials/06_DCEM.ipynb Outdated Show resolved Hide resolved
tests/optimizer/nonlinear/test_dcem.py Outdated Show resolved Hide resolved
theseus/optimizer/nonlinear/dcem.py Outdated Show resolved Hide resolved
@luisenp luisenp mentioned this pull request Mar 22, 2023
@luisenp luisenp merged commit 71abf01 into main Mar 23, 2023
@luisenp luisenp deleted the dishank.dcem branch March 23, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants