强化学习图书馆
anyrl的Python项目详细描述
#任何PY
这是[anyrl](https://github.com/unixpickle/anyrl)的python重拍(和改造)。它是一个强化学习的通用库,旨在尽可能模块化。
#安装
您可以使用pip安装任何rl:
` pip install anyrl `
#API
anyrl中有几个不同的子模块:
- models: abstractions and concrete implementations of RL models. This includes actor-critic RNNs, MLPs, CNNs, etc. Takes care of sequence padding, BPTT, etc.
- envs: APIs for dealing with environments, including wrappers and asynchronous environments.
- rollouts: APIs for gathering and manipulating batches of episodes or partial episodes. Many RL algorithms include a “gather trajectories” step, and this sub-module fulfills that role.
- algos: well-known learning algorithms like policy gradients or PPO. Also includes mini-algorithms like Generalized Advantage Estimation.
- spaces: tools for using action and observation spaces. Includes parameterized probability distributions for implementing stochastic policies.
#动机
目前,大多数rl代码是非常有限的,并且没有正确地分离。相反,ANYRL的目的是极其模块化和灵活。目标是分离代理、学习算法、轨迹和gae之类的东西。
例如,anyrl将卷展栏与学习算法分离(如果可能)。这样,您可以以几种不同的方式收集卷展栏,并且仍然将结果输入到一个学习算法中。而且,更明显的是,您不必为实现的每个新rl算法重写卷展栏代码。然而,像a3c和进化策略这样的算法可能有特定的方法来执行不能依赖于rollout api的rollout。
#TensorFlow的使用
这个项目依赖于tensorflow的模型和训练算法。然而,任何rl api在可能的情况下都是框架无关的。例如,rollout api可以用于任何策略,无论是tensorflow神经网络还是本机python决策林。
#样式
我使用了autopep8和flake8。下面是用于运行autoep8的命令:
` autopep8 --recursive--in-place--max-line-length 100 . `
我建议flake8使用以下标志:–max line length=100