RLcycle(发音为"recycle")是一个强化学习(RL)代理框架。RLcycle提供现成的RL代理,以及可重用的组件,便于快速原型开发。
目前,RLcycle提供:
RLcycle使用:
请参阅下文了解RLcycle的介绍和使用指南、性能基准测试以及未来计划。
如果你有任何问题或建议,欢迎提出问题或通过cjy2129 [at] columbia [dot] edu
联系我们!
安装方法:
conda create --name myenv python=3.6.9 pip
conda activate myenv
git clone https://github.com/cyoon1729/RLcycle.git
cd RLcycle
pip install -U -r requirements.txt
pip install -e .
<details>
<summary> <b> 0. 快速了解Hydra管理配置 </b></summary>
让我们首先看看<a href=https://hydra.cc/>Hydra</a>可以做的许多有用的事情之一:
"""从yaml文件实例化类""" # 在 ./examples/rectangle.yaml 中 shape: class: examples.shapes.Rectangle params: height: 5 width: 4
使用hydra
按照上述yaml文件初始化shapes.Rectangle
:
"""从yaml文件实例化类""" # 在 ./examples/shapes.py 中 class Rectangle: def __init__(self, width: float, height: float): self.width = width self.height = height def get_area(self): return width * height # 在 ./examples/main.py 中 import hydra from omegaconf import DictConfig @hydra.main(config_path="./examples/rectangle.yaml") def main(cfg: DictConfig): shape = hydra.utils.instantiate(layer_info) print(shape.__class__.__name__) # 'Rectangle' print(shape.get_area()) # 20 if __main__ == "__main__": main()
如果你想了解更多关于Hydra
的信息,请查看<a href=https://hydra.cc/>他们的文档</a>!
运行run_agent.py
文件,并按以下方式指定实验配置:
python run_agent.py configs=atari/rainbow_dqn
或者,你可以在metaconfig.yaml
中指定配置(yaml)文件。
# 在 ./metaconfig.yaml 中 defaults: - configs=atari/rainbow_dqn