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

[Feature] Extract primers from modules that contain RNNs #2127

Merged
merged 11 commits into from
May 3, 2024

Conversation

albertbou92
Copy link
Contributor

@albertbou92 albertbou92 commented Apr 28, 2024

Description

This PR adds a utils method to address #1771

Motivation and Context

Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax close #15213 if this solves the issue #15213

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Remove all that do not 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 examples)

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.

Copy link

pytorch-bot bot commented Apr 28, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/2127

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 2 Unrelated Failures

As of commit f48eb0c with merge base 68101b0 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@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 Apr 28, 2024
@albertbou92 albertbou92 changed the title [WIP] Extract primers from modules that contain RNNs Extract primers from modules that contain RNNs Apr 29, 2024
@@ -1597,12 +1597,18 @@ def __init__(
if high is not None:
raise TypeError(self.CONFLICTING_KWARGS.format("high", "maximum"))
high = kwargs.pop("maximum")
warnings.warn("Maximum is deprecated since v0.4.0, using high instead.", category=DeprecationWarning)
warnings.warn(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pre-commit reformatted this

@vmoens vmoens changed the title Extract primers from modules that contain RNNs [Feature] Extract primers from modules that contain RNNs Apr 30, 2024
Copy link
Contributor

@vmoens vmoens left a comment

Choose a reason for hiding this comment

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

Thanks so much for this!

Here is what is missing:

  • Add the function to the doc
  • Provide an example.
  • Add test for the feature.
  • Cross reference this class in tensordict primer and rnns.

torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
@vmoens vmoens added the enhancement New feature or request label Apr 30, 2024
torchrl/envs/transforms/transforms.py Outdated Show resolved Hide resolved
torchrl/modules/tensordict_module/rnn.py Outdated Show resolved Hide resolved
torchrl/modules/tensordict_module/rnn.py Outdated Show resolved Hide resolved
torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
torchrl/modules/utils/utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@vmoens vmoens left a comment

Choose a reason for hiding this comment

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

Can we write a couple of tests for this feature? Thanks!

@albertbou92
Copy link
Contributor Author

I was about to push them haha

@albertbou92 albertbou92 requested a review from vmoens April 30, 2024 15:52
Copy link
Contributor

@vmoens vmoens left a comment

Choose a reason for hiding this comment

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

LGTM!

@vmoens vmoens merged commit 7348af3 into pytorch:main May 3, 2024
52 of 58 checks passed
@vmoens vmoens deleted the extract_module_primers branch May 3, 2024 08:34
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.

None yet

3 participants