Obstacle Tower Challenge 项目教程
1. 项目的目录结构及介绍
obstacle-tower-challenge/
├── README.md
├── LICENSE
├── obstacle_tower_env.py
├── setup.py
├── requirements.txt
├── examples/
│ ├── example_agent.py
│ ├── train_agent.py
│ └── evaluate_agent.py
├── docs/
│ ├── index.md
│ └── installation.md
└── tests/
├── test_environment.py
└── test_agent.py
- README.md: 项目介绍和使用说明。
- LICENSE: 项目许可证,采用Apache-2.0许可证。
- obstacle_tower_env.py: 环境核心文件,定义了Obstacle Tower环境。
- setup.py: 项目安装脚本。
- requirements.txt: 项目依赖文件。
- examples/: 示例代码目录,包含训练和评估代理的示例脚本。
- docs/: 项目文档目录,包含安装和使用文档。
- tests/: 测试代码目录,包含环境测试和代理测试脚本。
2. 项目的启动文件介绍
obstacle_tower_env.py
obstacle_tower_env.py
是项目的核心启动文件,定义了Obstacle Tower环境。通过该文件可以启动和交互环境。
from obstacle_tower_env import ObstacleTowerEnv
env = ObstacleTowerEnv(retro=True)
env.reset()
example_agent.py
examples/example_agent.py
是一个示例代理脚本,展示了如何与环境进行交互。
from obstacle_tower_env import ObstacleTowerEnv
from example_agent import ExampleAgent
env = ObstacleTowerEnv(retro=True)
agent = ExampleAgent()
obs = env.reset()
done = False
while not done:
action = agent.act(obs)
obs, reward, done, info = env.step(action)
3. 项目的配置文件介绍
requirements.txt
requirements.txt
列出了项目运行所需的依赖包。
unityagents==0.4.0
gym==0.17.2
numpy==1.18.1
setup.py
setup.py
是项目的安装脚本,用于安装项目及其依赖。
from setuptools import setup, find_packages
setup(
name='obstacle-tower-challenge',
version='1.0',
packages=find_packages(),
install_requires=[
'unityagents==0.4.0',
'gym==0.17.2',
'numpy==1.18.1'
],
)
通过以上配置文件和启动文件,可以快速启动和配置Obstacle Tower Challenge项目。