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(pu): add board_games env #356

Merged
merged 9 commits into from
Jun 23, 2022

Conversation

puyuan1996
Copy link
Collaborator

add board_games env including tictactoe, gomoku, chess, go, atari derived from class BaseGameEnv.

Description

Related Issue

TODO

Check List

  • merge the latest version source branch/repo, and resolve all the conflicts
  • pass style check
  • pass all the tests

@puyuan1996 puyuan1996 added the env Questions about RL environment label Jun 10, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #356 (52d011c) into main (e477a08) will decrease coverage by 1.02%.
The diff coverage is 75.99%.

@@            Coverage Diff             @@
##             main     #356      +/-   ##
==========================================
- Coverage   86.74%   85.72%   -1.03%     
==========================================
  Files         513      525      +12     
  Lines       39463    41079    +1616     
==========================================
+ Hits        34234    35213     +979     
- Misses       5229     5866     +637     
Flag Coverage Δ
unittests 85.72% <75.99%> (-1.03%) ⬇️

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

Impacted Files Coverage Δ
ding/entry/tests/test_serial_entry_onpolicy.py 80.39% <ø> (-0.10%) ⬇️
ding/envs/common/common_function.py 93.10% <ø> (-0.95%) ⬇️
ding/envs/env_manager/tests/conftest.py 95.65% <ø> (-0.21%) ⬇️
ding/framework/middleware/functional/collector.py 97.01% <ø> (-0.09%) ⬇️
ding/policy/__init__.py 100.00% <ø> (ø)
ding/rl_utils/efficientzero/game.py 24.00% <24.00%> (ø)
ding/rl_utils/efficientzero/utils.py 33.33% <33.33%> (ø)
ding/entry/application_entry_drex_collect_data.py 88.12% <50.00%> (-0.98%) ⬇️
ding/framework/tests/test_supervisor.py 69.00% <69.00%> (ø)
ding/policy/bc.py 89.47% <80.55%> (+14.96%) ⬆️
... and 241 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8116476...52d011c. Read the comment docs.

@puyuan1996 puyuan1996 mentioned this pull request Jun 11, 2022
3 tasks
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/base_config.py Outdated Show resolved Hide resolved
dizoo/board_games/base_game_env.py Outdated Show resolved Hide resolved
dizoo/board_games/chess/envs/chess_env_game.py Outdated Show resolved Hide resolved
dizoo/board_games/chess/envs/test_chess.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/model/tictactoe_model.py Outdated Show resolved Hide resolved
ding/rl_utils/efficientzero/utils.py Outdated Show resolved Hide resolved
ding/rl_utils/efficientzero/utils.py Outdated Show resolved Hide resolved
dizoo/atari/envs/atari_muzero_env.py Outdated Show resolved Hide resolved
def render(self, mode='human'):
self._env.render()

def human_to_action(self):
Copy link
Member

Choose a reason for hiding this comment

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

this method is unnecessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

may be used in test_atari_muzero_env.py, to be consistent with other board_games env

dizoo/atari/envs/atari_muzero_env.py Outdated Show resolved Hide resolved
dizoo/board_games/base_game_env.py Outdated Show resolved Hide resolved
ding/rl_utils/efficientzero/game.py Outdated Show resolved Hide resolved
dizoo/board_games/gomoku/model/gomoku_model.py Outdated Show resolved Hide resolved
@@ -0,0 +1,95 @@
# Copyright 2018 Google LLC
Copy link
Member

Choose a reason for hiding this comment

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

can we overwrite these codes for reducing usage of other codes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can do it later after the main part is done

Copy link
Member

Choose a reason for hiding this comment

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

asap, to avoid some license problems

ding/utils/compression_helper.py Outdated Show resolved Hide resolved
dizoo/atari/envs/atari_muzero_env.py Outdated Show resolved Hide resolved
dizoo/atari/envs/atari_muzero_env.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/tictactoe/envs/tictactoe_env.py Outdated Show resolved Hide resolved
dizoo/board_games/gomoku/envs/gomoku_env.py Outdated Show resolved Hide resolved
dizoo/board_games/gomoku/envs/gomoku_env.py Outdated Show resolved Hide resolved
@@ -0,0 +1,95 @@
# Copyright 2018 Google LLC
Copy link
Member

Choose a reason for hiding this comment

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

asap, to avoid some license problems

@PaParaZz1 PaParaZz1 merged commit f843b19 into opendilab:main Jun 23, 2022
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