Skip to content

[RLlib; Offline RL] Add configuration parameter ignore_final_observation and automatic episode ID generation.#52107

Merged
sven1977 merged 5 commits intoray-project:masterfrom
simonsays1980:offline-rl-add-option-to-ignore-last-obs
Apr 9, 2025
Merged

[RLlib; Offline RL] Add configuration parameter ignore_final_observation and automatic episode ID generation.#52107
sven1977 merged 5 commits intoray-project:masterfrom
simonsays1980:offline-rl-add-option-to-ignore-last-obs

Conversation

@simonsays1980
Copy link
Copy Markdown
Contributor

@simonsays1980 simonsays1980 commented Apr 8, 2025

Why are these changes needed?

Users who run simple behavior cloning on their data need to provide a next state in Columns.NEXT_OBS of their data set. Because the next state is not used in BC many users might not have this. This PR proposes a new parameter ignore_final_observation in offline settings to set last states by default to zero.

In addition this PR adds an automatic ID generation if Columns.EPS_ID cannot be found in the schema.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • 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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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 :(

… final observations to zero. Furthermore added a test for this parameter. In addition added an automatic episode ID generation in '_map_to_episodes' in 'OfflinePreLearner'.

Signed-off-by: simonsays1980 <simon.zehnder@gmail.com>
@simonsays1980 simonsays1980 marked this pull request as ready for review April 8, 2025 19:58
@simonsays1980 simonsays1980 requested a review from sven1977 as a code owner April 8, 2025 19:58
Signed-off-by: Sven Mika <sven@anyscale.io>
Copy link
Copy Markdown
Contributor

@sven1977 sven1977 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this simplification enhancement @simonsays1980 !

@sven1977 sven1977 enabled auto-merge (squash) April 9, 2025 12:23
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Apr 9, 2025
@sven1977 sven1977 merged commit 6a37c7d into ray-project:master Apr 9, 2025
6 of 7 checks passed
han-steve pushed a commit to han-steve/ray that referenced this pull request Apr 11, 2025
…tion` and automatic episode ID generation. (ray-project#52107)

Signed-off-by: Steve Han <stevehan2001@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-backlog go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants