[RLLib] Episode media logging support #14767
Merged
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.
Why are these changes needed?
There is currently no way of transporting episode data such as images or videos for custom environments such as multi-agent environments to logging callbacks such as
WandbLoggerCallback
.This patch allows agent callbacks to add arbitrary serializable media data such as wandb.Video() to an
episode.media
object which is then collated and returned as part of theresult
(which is used in both training and evaluation)The episode media can be customized in any of the episode callbacks, for example on episode end:
In summary this provides generic support for logging any custom environment media including seperate videos per-agent in mutli-agent enviroments.
Related issue number
#13169
#8403
Checks
scripts/format.sh
to lint the changes in this PR.@sven1977 This is my first (of hopefully many) commits to rllib. It would be great to get some advice on whats expected other than these tick-boxes here. for example I could definitely include a documentation change here, but seems like it makes more sense to get the code reviewed first before writing docs for it.