All Projects → keiohta → Tf2rl

keiohta / Tf2rl

Licence: mit
TensorFlow2 Reinforcement Learning

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tf2rl

Reinforcement learning tutorial with demo
Reinforcement Learning Tutorial with Demo: DP (Policy and Value Iteration), Monte Carlo, TD Learning (SARSA, QLearning), Function Approximation, Policy Gradient, DQN, Imitation, Meta Learning, Papers, Courses, etc..
Stars: ✭ 442 (+25.21%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning, imitation-learning
Deterministic Gail Pytorch
PyTorch implementation of Deterministic Generative Adversarial Imitation Learning (GAIL) for Off Policy learning
Stars: ✭ 44 (-87.54%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning, imitation-learning
Easy Rl
强化学习中文教程,在线阅读地址:https://datawhalechina.github.io/easy-rl/
Stars: ✭ 3,004 (+750.99%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning, imitation-learning
Reinforcement Learning
Learn Deep Reinforcement Learning in 60 days! Lectures & Code in Python. Reinforcement Learning + Deep Learning
Stars: ✭ 3,329 (+843.06%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Drq
DrQ: Data regularized Q
Stars: ✭ 268 (-24.08%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Rlgraph
RLgraph: Modular computation graphs for deep reinforcement learning
Stars: ✭ 272 (-22.95%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
imitation learning
PyTorch implementation of some reinforcement learning algorithms: A2C, PPO, Behavioral Cloning from Observation (BCO), GAIL.
Stars: ✭ 93 (-73.65%)
Mutual labels:  deep-reinforcement-learning, imitation-learning
Openai lab
An experimentation framework for Reinforcement Learning using OpenAI Gym, Tensorflow, and Keras.
Stars: ✭ 313 (-11.33%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Tensorforce
Tensorforce: a TensorFlow library for applied reinforcement learning
Stars: ✭ 3,062 (+767.42%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Pytorch Soft Actor Critic
PyTorch implementation of soft actor critic
Stars: ✭ 300 (-15.01%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Neural Symbolic Machines
Neural Symbolic Machines is a framework to integrate neural networks and symbolic representations using reinforcement learning, with applications in program synthesis and semantic parsing.
Stars: ✭ 305 (-13.6%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Rad
RAD: Reinforcement Learning with Augmented Data
Stars: ✭ 268 (-24.08%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Gym Gazebo2
gym-gazebo2 is a toolkit for developing and comparing reinforcement learning algorithms using ROS 2 and Gazebo
Stars: ✭ 257 (-27.2%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Deeprl Tensorflow2
🐋 Simple implementations of various popular Deep Reinforcement Learning algorithms using TensorFlow2
Stars: ✭ 319 (-9.63%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
pytorchrl
Deep Reinforcement Learning algorithms implemented in PyTorch
Stars: ✭ 47 (-86.69%)
Mutual labels:  deep-reinforcement-learning, imitation-learning
Deep rl
PyTorch implementations of Deep Reinforcement Learning algorithms (DQN, DDQN, A2C, VPG, TRPO, PPO, DDPG, TD3, SAC, SAC-AEA)
Stars: ✭ 291 (-17.56%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Gdrl
Grokking Deep Reinforcement Learning
Stars: ✭ 304 (-13.88%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Rlzoo
A Comprehensive Reinforcement Learning Zoo for Simple Usage 🚀
Stars: ✭ 342 (-3.12%)
Mutual labels:  reinforcement-learning, deep-reinforcement-learning
Irl Imitation
Implementation of Inverse Reinforcement Learning (IRL) algorithms in python/Tensorflow. Deep MaxEnt, MaxEnt, LPIRL
Stars: ✭ 333 (-5.67%)
Mutual labels:  reinforcement-learning, imitation-learning
Awesome Carla
👉 CARLA resources such as tutorial, blog, code and etc https://github.com/carla-simulator/carla
Stars: ✭ 246 (-30.31%)
Mutual labels:  reinforcement-learning, imitation-learning

Build Status Coverage Status MIT License GitHub issues open PyPI version

TF2RL

TF2RL is a deep reinforcement learning library that implements various deep reinforcement learning algorithms using TensorFlow 2.x.

Algorithms

Following algorithms are supported:

Algorithm Dicrete action Continuous action Support Category
VPG, PPO GAE Model-free On-policy RL
DQN (including DDQN, Prior. DQN, Duel. DQN, Distrib. DQN, Noisy DQN) - ApeX Model-free Off-policy RL
DDPG (including TD3, BiResDDPG) - ApeX Model-free Off-policy RL
SAC ApeX Model-free Off-policy RL
CURL - - Model-free Off-policy RL
MPC, ME-TRPO - Model-base RL
GAIL, GAIfO, VAIL (including Spectral Normalization) - Imitation Learning

Following papers have been implemented in tf2rl:

Also, some useful techniques are implemented:

Installation

You can install tf2rl from PyPI:

$ pip install tf2rl

or, you can also install from source:

$ git clone https://github.com/keiohta/tf2rl.git tf2rl
$ cd tf2rl
$ pip install .

Preinstalled Docker Container

Instead of installing tf2rl on your (virtual) system, you can use preinstalled Docker containers.

Only the first execution requires time to download the container image.

At the following commands, you need to replace <version> with the version tag which you want to use.

CPU Only

The following simple command starts preinstalled container.

docker run -it ghcr.io/keiohta/tf2rl/cpu:<version> bash

If you also want to mount your local directory /local/dir/path at container /mount/point

docker run -it -v /local/dir/path:/mount/point ghcr.io/keiohta/tf2rl/cpu:<version> bash

GPU Support (Linux Only, Experimental)

WARNING: We encountered unsolved errors when running ApeX multiprocess learning.

Requirements

  • Linux
  • NVIDIA GPU
    • TF2.2 compatible driver
  • Docker 19.03 or later

The following simple command starts preinstalled container.

docker run --gpus all -it ghcr.io/keiohta/tf2rl/nvidia:<version> bash

If you also want to mount your local directory /local/dir/path at container /mount/point

docker run --gpus all -it -v /local/dir/path:/mount/point ghcr.io/keiohta/tf2rl/nvidia:<version> bash

If your container can see GPU correctly, you can check inside container by the following comand;

nvidia-smi

Getting started

Here is a quick example of how to train DDPG agent on a Pendulum environment:

import gym
from tf2rl.algos.ddpg import DDPG
from tf2rl.experiments.trainer import Trainer


parser = Trainer.get_argument()
parser = DDPG.get_argument(parser)
args = parser.parse_args()

env = gym.make("Pendulum-v0")
test_env = gym.make("Pendulum-v0")
policy = DDPG(
    state_shape=env.observation_space.shape,
    action_dim=env.action_space.high.size,
    gpu=-1,  # Run on CPU. If you want to run on GPU, specify GPU number
    memory_capacity=10000,
    max_action=env.action_space.high[0],
    batch_size=32,
    n_warmup=500)
trainer = Trainer(policy, env, args, test_env=test_env)
trainer()

You can check implemented algorithms in examples. For example if you want to train DDPG agent:

# You must change directory to avoid importing local files
$ cd examples
# For options, please specify --help or read code for options
$ python run_ddpg.py [options]

You can see the training progress/results from TensorBoard as follows:

# When executing `run_**.py`, its logs are automatically generated under `./results`
$ tensorboard --logdir results

Citation

@misc{ota2020tf2rl,
  author = {Kei Ota},
  title = {TF2RL},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/keiohta/tf2rl/}}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].