heronsystems / adeptRL

Reinforcement learning framework to accelerate research
GNU General Public License v3.0
204 stars 29 forks source link
actor-critic artificial-intelligence atari pysc2 pytorch reinforcement-learning starcraft2-ai

banner

adept is a reinforcement learning framework designed to accelerate research by abstracting away engineering challenges associated with deep reinforcement learning. adept provides:

This code is early-access, expect rough edges. Interfaces subject to change. We're happy to accept feedback and contributions.

Read More

Documentation

Examples

Installation

git clone https://github.com/heronsystems/adeptRL
cd adeptRL
pip install -e .[all]

From docker:

Quickstart

Train an Agent Logs go to /tmp/adept_logs/ by default. The log directory contains the tensorboard file, saved models, and other metadata.

# Local Mode (A2C)
# We recommend 4GB+ GPU memory, 8GB+ RAM, 4+ Cores
python -m adept.app local --env BeamRiderNoFrameskip-v4

# Distributed Mode (A2C, requires NCCL)
# We recommend 2+ GPUs, 8GB+ GPU memory, 32GB+ RAM, 4+ Cores
python -m adept.app distrib --env BeamRiderNoFrameskip-v4

# IMPALA (requires ray, resource intensive)
# We recommend 2+ GPUs, 8GB+ GPU memory, 32GB+ RAM, 4+ Cores
python -m adept.app actorlearner --env BeamRiderNoFrameskip-v4

# To see a full list of options:
python -m adept.app -h
python -m adept.app help <command>

Use your own Agent, Environment, Network, or SubModule

"""
my_script.py

Train an agent on a single GPU.
"""
from adept.scripts.local import parse_args, main
from adept.network import NetworkModule, SubModule1D
from adept.agent import AgentModule
from adept.env import EnvModule

class MyAgent(AgentModule):
    pass  # Implement

class MyEnv(EnvModule):
    pass  # Implement

class MyNet(NetworkModule):
    pass  # Implement

class MySubModule1D(SubModule1D):
    pass  # Implement

if __name__ == '__main__':
    import adept
    adept.register_agent(MyAgent)
    adept.register_env(MyEnv)
    adept.register_network(MyNet)
    adept.register_submodule(MySubModule1D)
    main(parse_args())

Features

Scripts

Local (Single-node, Single-GPU)

Distributed (Multi-node, Multi-GPU)

Importance Weighted Actor Learner Architectures, IMPALA (Single Node, Multi-GPU)

Agents

Networks

Environments

Performance

Acknowledgements

We borrow pieces of OpenAI's gym and baselines code. We indicate where this is done.