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

feature(zc): add carracing in box2d #575

Merged
merged 10 commits into from
Feb 9, 2023
Merged

Conversation

Super1ce
Copy link
Contributor

@Super1ce Super1ce commented Feb 3, 2023

Description

Add CarRacing env and config of DQN
result:
image

Related Issue

TODO

@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #575 (3b55f7a) into main (b218ea7) will increase coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #575      +/-   ##
==========================================
+ Coverage   83.60%   83.67%   +0.06%     
==========================================
  Files         562      564       +2     
  Lines       46020    46110      +90     
==========================================
+ Hits        38477    38581     +104     
+ Misses       7543     7529      -14     
Flag Coverage Δ
unittests 83.67% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ding/utils/data/dataloader.py 46.11% <0.00%> (-1.04%) ⬇️
ding/framework/middleware/distributer.py 87.50% <0.00%> (-0.50%) ⬇️
ding/model/template/__init__.py 100.00% <0.00%> (ø)
ding/model/template/procedure_cloning.py 100.00% <0.00%> (ø)
...ing/model/template/tests/test_procedure_cloning.py 100.00% <0.00%> (ø)
ding/data/model_loader.py 87.23% <0.00%> (+1.06%) ⬆️
ding/framework/message_queue/redis.py 79.24% <0.00%> (+1.88%) ⬆️
ding/framework/message_queue/tests/test_nng.py 100.00% <0.00%> (+57.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@PaParaZz1 PaParaZz1 added the env Questions about RL environment label Feb 7, 2023
@Super1ce Super1ce changed the title add carracing in box2d Feature(zc):add carracing in box2d Feb 7, 2023
@Super1ce Super1ce changed the title Feature(zc):add carracing in box2d feature(zc):add carracing in box2d Feb 7, 2023
dizoo/box2d/carracing/config/__init__.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/envs/carracing_env.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/envs/test_carracing_env.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/envs/carracing_env.py Show resolved Hide resolved
dizoo/box2d/carracing/config/carracing_dqn_config.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/config/carracing_dqn_config.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/config/carracing_dqn_config.py Outdated Show resolved Hide resolved
@PaParaZz1 PaParaZz1 changed the title feature(zc):add carracing in box2d feature(zc): add carracing in box2d Feb 7, 2023
dizoo/box2d/carracing/config/carracing_dqn_config.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/envs/carracing_env.py Outdated Show resolved Hide resolved
dizoo/box2d/carracing/envs/test_carracing_env.py Outdated Show resolved Hide resolved
@PaParaZz1
Copy link
Member

add the information of this env in env table


nstep = 3
carracing_dqn_config = dict(
exp_name='carracing_dqn_seed0-withouconfig',
Copy link
Member

Choose a reason for hiding this comment

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

polish exp_name

self._replay_path_gif = cfg.replay_path_gif
self._save_replay_gif = cfg.save_replay_gif
self._save_replay_count = 0
if 'Continuous' in self._env_id:
Copy link
Member

Choose a reason for hiding this comment

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

remove Continuous related codes, which is abandoned in latest gym

self._env = ObsPlusPrevActRewWrapper(self._env)
# self._observation_space = self._env.observation_space
self._observation_space = gym.spaces.Box(
low=np.min(self._env.observation_space.low),
Copy link
Member

Choose a reason for hiding this comment

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

correct range (after dividing 255)

episode_trigger=lambda episode_id: True,
name_prefix='rl-video-{}'.format(id(self))
)
if hasattr(self._cfg, 'obs_plus_prev_action_reward') and self._cfg.obs_plus_prev_action_reward:
Copy link
Member

Choose a reason for hiding this comment

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

remove this wrapper, it is only used in some special cases.

@PaParaZz1 PaParaZz1 merged commit b36dd80 into opendilab:main Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env Questions about RL environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants