Fix sparse Wipe marker rewards - #822
Open
tandede wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Fixes #418.
Wipe.reward()documentsunit_wiped_rewardas a discrete reward for every marker wiped during the current step. The normalization factor also includesnum_markers * unit_wiped_reward, so that component is part of the intended return for both reward modes. However, the implementation added it only whenreward_shaping=True. With sparse rewards, newly wiped markers were made transparent and recorded inwiped_markers, but contributed no reward unless the final marker also completed the task.This change moves only the per-marker increment outside the dense-reward condition. Dense rewards keep their existing distance, contact, force, acceleration, and completion components; sparse rewards now receive the documented marker reward while retaining the existing collision and completion behavior.
A focused regression invokes the reward calculation with a minimal simulated Wipe state and verifies that, with
reward_shaping=False, a newly wiped marker:unit_wiped_reward;wiped_markers; andHow it was tested
python -m pytest tests/test_environments/test_wipe_reward.py tests/test_environments(5 passed)python -m pytest(262 passed, 61 skipped)pre-commit run --files robosuite/environments/manipulation/wipe.py tests/test_environments/test_wipe_reward.py.github/workflows/run-tests.yaml(strict error count:0)git diff --checkHow to checkout & try? (for the reviewer)