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

[Algo] Update offpolicy examples #1206

Merged
merged 55 commits into from
Jun 3, 2023
Merged

Conversation

BY571
Copy link
Contributor

@BY571 BY571 commented May 30, 2023

Description

Updating the off-policy examples for ddpg, td3 and sac to simple scripts

@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 May 30, 2023
@vmoens vmoens changed the title Update offpolicy examples [Algo] Update offpolicy examples May 30, 2023
@vmoens vmoens added the new algo New algorithm request or PR label May 30, 2023
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
Would it make sense to have configs a bit more "structured" like

collector:
  frames_per_batch: 1000

replay_buffer:
  size: 1_000_000

then access the fields through

cfg.collector.frames_per_batch

?

Also, how deep do we want the config to be? Maybe we could let the users control the number of cells etc?

Don't we need to update the examples worflow in the CI?

examples/td3/config.yaml Outdated Show resolved Hide resolved
examples/ddpg/ddpg.py Outdated Show resolved Hide resolved
Comment on lines +93 to +94
alpha=0.7,
beta=0.5,
Copy link
Contributor

Choose a reason for hiding this comment

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

we could make that parametrizable too

examples/ddpg/utils.py Outdated Show resolved Hide resolved
examples/ddpg/utils.py Outdated Show resolved Hide resolved
examples/ddpg/utils.py Outdated Show resolved Hide resolved
examples/sac/sac.py Outdated Show resolved Hide resolved
examples/sac/sac.py Outdated Show resolved Hide resolved
examples/sac/utils.py Outdated Show resolved Hide resolved
examples/td3/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.

LGTM
Would it make sense to have configs a bit more "structured" like

collector:
  frames_per_batch: 1000

replay_buffer:
  size: 1_000_000

then access the fields through

cfg.collector.frames_per_batch

?

Also, how deep do we want the config to be? Maybe we could let the users control the number of cells etc?

Don't we need to update the examples worflow in the CI?

torchrl/objectives/sac.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.

Final review

@vmoens vmoens merged commit e955cfc into pytorch:main Jun 3, 2023
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. new algo New algorithm request or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants