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

NoDeath wrapper #374

Merged
merged 4 commits into from
Jul 5, 2023
Merged

NoDeath wrapper #374

merged 4 commits into from
Jul 5, 2023

Conversation

sparisi
Copy link
Contributor

@sparisi sparisi commented Jul 4, 2023

New wrapper that prevents death in states like obstacles or lava, and gives an optional negative reward instead.

Description

The wrapper makes it possible to investigate exploration and safety.
Making it possible to walk on lava (at a cost) would make exploration more interesting because the agent can find some "aggressive" exploration strategies, like walking over lava to explore as much as possible. This would be a scenario that should be avoided in safe RL.

More discussion here
#372

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

New wrapper that prevents death in states like obstacles or lava, and gives an optional negative reward instead.

More discussion here
#372
@sparisi
Copy link
Contributor Author

sparisi commented Jul 4, 2023

I am not sure why the pre-commit fails. If I run it locally, it failed the first time but succeeded after that.

Copy link
Member

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Choose a reason for hiding this comment

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

Could you make these two documentation changes otherwise, looks good to merge to me
@BolunDai0216 Any other comments?

minigrid/wrappers.py Outdated Show resolved Hide resolved
minigrid/wrappers.py Outdated Show resolved Hide resolved
sparisi added 2 commits July 4, 2023 15:23
- passing a tuple instead of a list
- explicitly passing arg name in example
@pseudo-rnd-thoughts
Copy link
Member

We run doctest in the CI, you need to update (-1, False) to (-1.0, False)
Run pytest --doctest gymnasium/ to check there aren't any issues

@sparisi
Copy link
Contributor Author

sparisi commented Jul 5, 2023

We run doctest in the CI, you need to update (-1, False) to (-1.0, False) Run pytest --doctest gymnasium/ to check there aren't any issues

Sorry about that, I am not very familiar with pytest and couldn't find where it was failing. Btw, the command was
pytest --doctest-modules minigrid/

Everything seems fine now.

@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit 091eea6 into Farama-Foundation:master Jul 5, 2023
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.

2 participants