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

[RLlib] CQL BC loss fixes; PPO/PG/A2|3C action normalization fixes #16531

Merged
merged 74 commits into from
Jun 30, 2021

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Jun 18, 2021

This PR fixes the following problems:

  • CQL's BC loss term is simplified (by using the existing SquashedGaussian distribution) and changed to be the same as BCTrainer's loss (rllib/agents/marwil/marwil.py).
  • A learning test case for Pendulum-v0 for CQL has been added for both tf and torch, utilizing BC and CQL phases and reading from an expert (SAC generated) output file.
  • Action normalization has been fixed (and enabled by default) in all trainers, allowing all PG (and PG+Q) algos to learn inside a normalized action space (from ~ -1.0 to 1.0). Actions are only unsquashed (and clipped for safety) before being sent back to the env. This e.g. allows PPO now to learn in a distorted pendulum env with an action space of e.g. Box(low=300.0, high=500.0). A test case for PPO learning in such an env has been added for both tf and torch.
  • A new config key has been added, in case actions in an offline file have not been normalized yet (i.e. have their original env/behavior policy values): actions_in_input_normalized. If False (AND normalize_actions=True), the offline reader will re-normalize the found actions - according to the given action-space - to make sure the algo can learn inside the normalized space.

Why are these changes needed?

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@sven1977 sven1977 merged commit 53206dd into ray-project:master Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants