Repository navigation
SB3 and gymnasium adapters: image_key, for camera observations - #3
Merged
Merged
Conversation
…ete action spaces With image_key, the observation is that one image as the client sent it. A uint8 [H, W, C] frame gives a uint8 Box(0, 255), which SB3's CnnPolicy and gymnasium take as an image. terminal_observation and final_obs follow. Without it nothing changes: state_keys flattened into float32. Discrete action spaces work as they are: an action crosses as one float per env. Two tests, with a fake client that sends a uint8 frame.
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.
Image observations for
PlugRLVecEnv(SB3) andPlugRLVectorEnv(gymnasium), for plugrl-server's E53, which compares SB3's CnnPolicy on Atari in-process and through the bridge.image_key. The observation is that one image, in the dtype the client sent.observation_space_ofturns a uint8 batch intoBox(0, 255, [H, W, C], uint8), which SB3'sis_image_spaceaccepts, so CnnPolicy andVecTransposeImageapply.terminal_observation(SB3) andfinal_obs(gymnasium) follow.image_key, nothing changes:state_keysare flattened into float32, with the same space.prod(())is 1, so an action crosses as one float per env. The new SB3 test now pins that down.