Skip to content

Commit

Permalink
polish(pu): polish requirements (#298)
Browse files Browse the repository at this point in the history
* polish(pu): polish requirements

* polish(pu): polish requirements

* polish(pu): polish readme
  • Loading branch information
puyuan1996 authored Nov 22, 2024
1 parent dfaebaa commit 9205e9f
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 51 deletions.
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[![GitHub license](https://img.shields.io/github/license/opendilab/LightZero)](https://github.com/opendilab/LightZero/blob/master/LICENSE)
[![discord badge](https://dcbadge.vercel.app/api/server/dkZS2JF56X?style=flat)](https://discord.gg/dkZS2JF56X)

Updated on 2024.08.18 LightZero-v0.1.0
Updated on 2024.11.23 LightZero-v0.1.0

English | [简体中文(Simplified Chinese)](https://github.com/opendilab/LightZero/blob/main/README.zh.md) | [Documentation](https://opendilab.github.io/LightZero) | [LightZero Paper](https://arxiv.org/abs/2310.08348) | [🔥UniZero Paper](https://arxiv.org/abs/2406.10667) | [🔥ReZero Paper](https://arxiv.org/abs/2404.16364)

Expand Down Expand Up @@ -58,25 +58,37 @@ For further details, please refer to [Features](#features), [Framework Structure

### Outline

- [Overview](#overview)
- [Outline](#outline)
- [Features](#features)
- [Framework Structure](#framework-structure)
- [Integrated Algorithms](#integrated-algorithms)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Documentation](#documentation)
- [Benchmark](#benchmark)
- [Awesome-MCTS Notes](#awesome-mcts-notes)
- [Paper Notes](#paper-notes)
- [Algo. Overview](#algo-overview)
- [Awesome-MCTS Papers](#awesome-mcts-papers)
- [Key Papers](#key-papers)
- [Other Papers](#other-papers)
- [Feedback and Contribution](#feedback-and-contribution)
- [Citation](#citation)
- [Acknowledgments](#acknowledgments)
- [License](#license)
- [LightZero](#lightzero)
- [🔍 Background](#-background)
- [🎨 Overview](#-overview)
- [Outline](#outline)
- [💥 Features](#-features)
- [🧩 Framework Structure](#-framework-structure)
- [🎁 Integrated Algorithms](#-integrated-algorithms)
- [⚙️ Installation](#️-installation)
- [Installation with Docker](#installation-with-docker)
- [🚀 Quick Start](#-quick-start)
- [📚 Documentation](#-documentation)
- [📊 Benchmark](#-benchmark)
- [📝 Awesome-MCTS Notes](#-awesome-mcts-notes)
- [Paper Notes](#paper-notes)
- [Algo. Overview](#algo-overview)
- [Awesome-MCTS Papers](#awesome-mcts-papers)
- [Key Papers](#key-papers)
- [LightZero Implemented series](#lightzero-implemented-series)
- [AlphaGo series](#alphago-series)
- [MuZero series](#muzero-series)
- [MCTS Analysis](#mcts-analysis)
- [MCTS Application](#mcts-application)
- [Other Papers](#other-papers)
- [ICML](#icml)
- [ICLR](#iclr)
- [NeurIPS](#neurips)
- [Other Conference or Journal](#other-conference-or-journal)
- [💬 Feedback and Contribution](#-feedback-and-contribution)
- [🌏 Citation](#-citation)
- [💓 Acknowledgments](#-acknowledgments)
- [🏷️ License](#️-license)

### 💥 Features

Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
[![Contributors](https://img.shields.io/github/contributors/opendilab/LightZero)](https://github.com/opendilab/LightZero/graphs/contributors)
[![GitHub license](https://img.shields.io/github/license/opendilab/LightZero)](https://github.com/opendilab/LightZero/blob/master/LICENSE)

最近更新于 2024.08.18 LightZero-v0.1.0
最近更新于 2024.11.23 LightZero-v0.1.0

[English](https://github.com/opendilab/LightZero/blob/main/README.md) | 简体中文 | [文档](https://opendilab.github.io/LightZero) | [LightZero 论文](https://arxiv.org/abs/2310.08348) | [🔥UniZero 论文](https://arxiv.org/abs/2406.10667) | [🔥ReZero 论文](https://arxiv.org/abs/2404.16364)

Expand Down
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
DI-engine>=0.4.7
gymnasium[atari]
moviepy
numpy>=1.22.4
pympler
minigrid
bsuite
moviepy
pycolab
pytest
pooltool-billiards>=0.3.1
line_profiler
xxhash
einops
12 changes: 8 additions & 4 deletions zoo/bsuite/envs/bsuite_lightzero_env.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import copy
import os
from datetime import datetime
from typing import Union, Optional, Dict, List
from typing import Optional, Dict, List

try:
import bsuite
from bsuite import sweep
from bsuite.utils import gym_wrapper
except ImportError:
raise ImportError("Please install the bsuite package: pip install bsuite")

import gymnasium as gym
import matplotlib.pyplot as plt
import numpy as np
import bsuite
from bsuite import sweep
from bsuite.utils import gym_wrapper
from ding.envs import BaseEnv, BaseEnvTimestep
from ding.torch_utils import to_ndarray
from ding.utils import ENV_REGISTRY
Expand Down
8 changes: 6 additions & 2 deletions zoo/bsuite/envs/check_bsuite_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import bsuite
from bsuite import sweep
try:
import bsuite
from bsuite import sweep
except ImportError:
raise ImportError("Please install the bsuite package: pip install bsuite")


# List the configurations for the given experiment
for bsuite_id in sweep.BANDIT_NOISE:
Expand Down
11 changes: 7 additions & 4 deletions zoo/memory/envs/pycolab_tvt/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
import colorsys

import numpy as np
from pycolab import ascii_art
from pycolab import cropping
from pycolab import things as plab_things
from pycolab.prefab_parts import sprites as prefab_sprites
try:
from pycolab import ascii_art
from pycolab import cropping
from pycolab import things as plab_things
from pycolab.prefab_parts import sprites as prefab_sprites
except ImportError:
raise ImportError("Please install the pycolab package: pip install pycolab")

# Actions.
# Those with a negative ID are not allowed for the agent.
Expand Down
6 changes: 5 additions & 1 deletion zoo/memory/envs/pycolab_tvt/human_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import numpy as np
from absl import app
from absl import flags
from pycolab import human_ui

try:
from pycolab import human_ui
except ImportError:
raise ImportError("Please install the pycolab package: pip install pycolab")

import common
import key_to_door
Expand Down
9 changes: 6 additions & 3 deletions zoo/memory/envs/pycolab_tvt/key_to_door.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
previously collected.
"""

from pycolab import ascii_art
from pycolab import storytelling
from pycolab import things as plab_things
try:
from pycolab import ascii_art
from pycolab import storytelling
from pycolab import things as plab_things
except ImportError:
raise ImportError("Please install the pycolab package: pip install pycolab")

from zoo.memory.envs.pycolab_tvt import common, game, objects

Expand Down
7 changes: 5 additions & 2 deletions zoo/memory/envs/pycolab_tvt/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
# ============================================================================
"""Pycolab sprites."""

from pycolab import things as plab_things
from pycolab.prefab_parts import sprites as prefab_sprites
try:
from pycolab import things as plab_things
from pycolab.prefab_parts import sprites as prefab_sprites
except ImportError:
raise ImportError("Please install the pycolab package: pip install pycolab")

from . import common

Expand Down
7 changes: 5 additions & 2 deletions zoo/memory/envs/pycolab_tvt/visual_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
the one of the same color as the colour in the first phase.
"""

from pycolab import ascii_art
from pycolab import storytelling
try:
from pycolab import ascii_art
from pycolab import storytelling
except ImportError:
raise ImportError("Please install the pycolab package: pip install pycolab")

from zoo.memory.envs.pycolab_tvt import common, game, objects

Expand Down
8 changes: 4 additions & 4 deletions zoo/pooltool/sum_to_three/envs/sum_to_three_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@
from __future__ import annotations

import gc

from dataclasses import dataclass, asdict
from typing import Optional

import numpy as np
import pooltool as pt
from ding.envs import BaseEnvTimestep
from ding.utils import ENV_REGISTRY
from easydict import EasyDict
from gym import spaces
from numpy.typing import NDArray

from zoo.pooltool.datatypes import (
Bounds,
ObservationDict,
Expand All @@ -56,9 +59,6 @@
Spaces,
State,
)
from gym import spaces

import pooltool as pt
from zoo.pooltool.image_representation import PygameRenderer, RenderConfig
from zoo.pooltool.sum_to_three.envs.utils import (
ObservationType,
Expand Down
9 changes: 5 additions & 4 deletions zoo/pooltool/sum_to_three/envs/test_sum_to_three_env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import math
import pytest

import numpy as np
import pooltool as pt
import pytest
from easydict import EasyDict

from zoo.pooltool.datatypes import Spaces
from zoo.pooltool.image_representation import PygameRenderer, RenderConfig
from zoo.pooltool.sum_to_three.envs.sum_to_three_env import (
Expand All @@ -10,15 +14,12 @@
create_initial_state,
get_action_space,
)

import pooltool as pt
from zoo.pooltool.sum_to_three.envs.utils import (
ObservationType,
get_coordinate_obs_space,
get_image_obs_space,
get_reward_space,
)
from easydict import EasyDict

np.random.seed(42)

Expand Down

0 comments on commit 9205e9f

Please sign in to comment.