All Projects → DeNA → HandyRL

DeNA / HandyRL

Licence: MIT license
HandyRL is a handy and simple framework based on Python and PyTorch for distributed reinforcement learning that is applicable to your own environments.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to HandyRL

flare
A Simple Browser Based Game.
Stars: ✭ 85 (-62.72%)
Mutual labels:  games
MHW-Shop-Editor
Monster Hunter World Provisions Stockpile Shop Editor
Stars: ✭ 52 (-77.19%)
Mutual labels:  games
mamesaver
Mamesaver is a mame emulated screensaver - get all the good ol' games playing their demo modes while you procrastinate and enjoy!
Stars: ✭ 26 (-88.6%)
Mutual labels:  games
Commandline-Games-hacktoberfest
A repository to share command line games. An opportunity to start and learn about open source code contributions flow.
Stars: ✭ 16 (-92.98%)
Mutual labels:  games
Jetpack-Joyride-CE
A port of the iOS and Android Jetpack Joyride game for smartphones for the TI-84 Plus CE graphing calculators.
Stars: ✭ 22 (-90.35%)
Mutual labels:  games
phaser-mario
Mario-like class for Phaser
Stars: ✭ 19 (-91.67%)
Mutual labels:  games
connect4
Solving board games like Connect4 using Deep Reinforcement Learning
Stars: ✭ 33 (-85.53%)
Mutual labels:  policy-gradient
gust tools
A set of utilities for dealing with Gust (Koei Tecmo) PC games files
Stars: ✭ 117 (-48.68%)
Mutual labels:  games
BlueVGA
VGA library for STM32F103C (BluePill) that can manipulate a screen with 28x30 tiles with 8x8 pixels each, in a total resolution of 224x240 pixels with 8 colors using a very low footprint
Stars: ✭ 39 (-82.89%)
Mutual labels:  games
sar2
Search and Rescue II. Helicopter flight simulator for Linux and OSX.
Stars: ✭ 20 (-91.23%)
Mutual labels:  games
goopylib
A simple-yet-powerful 2D graphics framework built on top of Tkinter capable of creating good-looking & modern GUIs, games, and simple animations.
Stars: ✭ 19 (-91.67%)
Mutual labels:  games
QuestJS
A major re-write of Quest that is written in JavaScript and will run in the browser.
Stars: ✭ 47 (-79.39%)
Mutual labels:  games
AssetRipper
GUI Application to work with engine assets, asset bundles, and serialized files
Stars: ✭ 820 (+259.65%)
Mutual labels:  games
manu.ninja
Frond-End Development, Games and Digital Art
Stars: ✭ 15 (-93.42%)
Mutual labels:  games
Explorer
Explorer is a PyTorch reinforcement learning framework for exploring new ideas.
Stars: ✭ 54 (-76.32%)
Mutual labels:  policy-gradient
jerry
Jerry - Chess Program
Stars: ✭ 79 (-65.35%)
Mutual labels:  games
EtherEngine
简明易用的 Lua 跨平台游戏接口
Stars: ✭ 132 (-42.11%)
Mutual labels:  games
GTA-One-Liners
A collection of gifs made out of almost every dialogue in GTA and other games.
Stars: ✭ 37 (-83.77%)
Mutual labels:  games
LudiiExampleAI
Project with examples for the implementation of third-party AI algorithms / agents for the Ludii general game system.
Stars: ✭ 20 (-91.23%)
Mutual labels:  games
Discord-Games
A library for making implementing conventional games into your discord bot, easier.
Stars: ✭ 31 (-86.4%)
Mutual labels:  games

HandyRL

Quick to Start, Easy to Win

  • Prepare your own environment
  • Let’s start large-scale distributed reinforcement learning
  • Get your strong AI agent!

HandyRL is a handy and simple framework based on Python and PyTorch for distributed reinforcement learning that is applicable to your own environments. HandyRL focuses on a practicable algorithm and implementation to create a strong and winning AI in competitive games. For large scale training, HandyRL provides a controllable high parallelism power according to your environment.

HandyRL is updated at the beginning of every month except for important updates. We appreciate all contributions. Please let us know if you find a bug or have a suggestion by creating an issue and a PR.

More About HandyRL

HandyRL mainly provides a policy gradient algorithm with off-policy correction. From the perspective of stability and performance, the off-policy version policy gradient works fine in practice. So it’s a good first choice to create a baseline AI model. You can use some off-policy variants of update methods (targets of policy and value) from traditional ones (monte carlo, TD(λ)) to novel ones (V-Trace, UPGO). These items can be changed in config.yaml.

As a training architecture, HandyRL adopts a learner-worker style architecture like IMPALA. The learner is a brain of training which updates a model and controls the workers. The workers have two roles. They asynchronously generate episodes (trajectories) and evaluate trained models. In episode generation, self-play is conducted as default.

Installation

Install dependencies

HandyRL supports Python3.7+. At first, copy or fork HandyRL repository to your environment. If you want to use this script in your private project, just copy the files to your project directory and modify it there.

git clone https://github.com/DeNA/HandyRL.git
cd HandyRL

Then, install additional libraries (e.g. numpy, pytorch). Or run it in a virtual environment or container (e.g. Docker).

pip3 install -r requirements.txt

To use games of kaggle environments (e.g. Hungry Geese) you can install also additional dependencies.

pip3 install -r handyrl/envs/kaggle/requirements.txt

Getting Started

Train AI Model for Tic-Tac-Toe

This section shows the training a model for Tic-Tac-Toe. Tic-Tac-Toe is a very simple game. You can play by googling "Tic-Tac-Toe".

Step 1: Set up configuration

Set config.yaml for your training configuration. When you run a training with Tic-Tac-Toe and batch size 64, set like the following:

env_args:
    env: 'TicTacToe'

train_args:
    ...
    batch_size: 64
    ...

NOTE: Here is the list of games implemented in HandyRL. All parameters are shown in Config Parameters.

Step 2: Train!

After creating the configuration, you can start training by running the following command. The trained models are saved in models folder every update_episodes described in config.yaml.

python main.py --train

Step 3: Evaluate

After training, you can evaluate the model against any models. The below code evaluate the model of epoch 1 for 100 games with 4 processes.

python main.py --eval models/1.pth 100 4

NOTE: Default opponent AI is random agent implemented in evaluation.py. You can change the agent with any of your agents.

Documentation

Use Cases

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].