All Projects → ntasfi → Pygame Learning Environment

ntasfi / Pygame Learning Environment

Licence: mit
PyGame Learning Environment (PLE) -- Reinforcement Learning Environment in Python.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pygame Learning Environment

Rlcard
Reinforcement Learning / AI Bots in Card (Poker) Games - Blackjack, Leduc, Texas, DouDizhu, Mahjong, UNO.
Stars: ✭ 980 (+18.36%)
Mutual labels:  ai, game, reinforcement-learning, deep-reinforcement-learning
Carla
Open-source simulator for autonomous driving research.
Stars: ✭ 7,012 (+746.86%)
Mutual labels:  artificial-intelligence, ai, research, deep-reinforcement-learning
Lagom
lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.
Stars: ✭ 364 (-56.04%)
Mutual labels:  artificial-intelligence, research, reinforcement-learning, deep-reinforcement-learning
Snake
Artificial intelligence for the Snake game.
Stars: ✭ 1,241 (+49.88%)
Mutual labels:  artificial-intelligence, game, reinforcement-learning, deep-reinforcement-learning
Airsim
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
Stars: ✭ 12,528 (+1413.04%)
Mutual labels:  artificial-intelligence, ai, research, deep-reinforcement-learning
Habitat Lab
A modular high-level library to train embodied AI agents across a variety of tasks, environments, and simulators.
Stars: ✭ 587 (-29.11%)
Mutual labels:  ai, research, reinforcement-learning, deep-reinforcement-learning
Free Ai Resources
🚀 FREE AI Resources - 🎓 Courses, 👷 Jobs, 📝 Blogs, 🔬 AI Research, and many more - for everyone!
Stars: ✭ 192 (-76.81%)
Mutual labels:  artificial-intelligence, ai, research, reinforcement-learning
Atari Model Zoo
A binary release of trained deep reinforcement learning models trained in the Atari machine learning benchmark, and a software release that enables easy visualization and analysis of models, and comparison across training algorithms.
Stars: ✭ 198 (-76.09%)
Mutual labels:  artificial-intelligence, ai, research, deep-reinforcement-learning
Reinforcement Learning
Learn Deep Reinforcement Learning in 60 days! Lectures & Code in Python. Reinforcement Learning + Deep Learning
Stars: ✭ 3,329 (+302.05%)
Mutual labels:  artificial-intelligence, reinforcement-learning, deep-reinforcement-learning
Csinva.github.io
Slides, paper notes, class notes, blog posts, and research on ML 📉, statistics 📊, and AI 🤖.
Stars: ✭ 342 (-58.7%)
Mutual labels:  artificial-intelligence, ai, research
Pysc2 Examples
StarCraft II - pysc2 Deep Reinforcement Learning Examples
Stars: ✭ 722 (-12.8%)
Mutual labels:  ai, reinforcement-learning, deep-reinforcement-learning
Gdrl
Grokking Deep Reinforcement Learning
Stars: ✭ 304 (-63.29%)
Mutual labels:  artificial-intelligence, reinforcement-learning, deep-reinforcement-learning
Dreamerv2
Mastering Atari with Discrete World Models
Stars: ✭ 287 (-65.34%)
Mutual labels:  artificial-intelligence, research, reinforcement-learning
Gibsonenv
Gibson Environments: Real-World Perception for Embodied Agents
Stars: ✭ 666 (-19.57%)
Mutual labels:  research, reinforcement-learning, deep-reinforcement-learning
Polyaxon
Machine Learning Platform for Kubernetes (MLOps tools for experimentation and automation)
Stars: ✭ 2,966 (+258.21%)
Mutual labels:  artificial-intelligence, ai, reinforcement-learning
Applied Reinforcement Learning
Reinforcement Learning and Decision Making tutorials explained at an intuitive level and with Jupyter Notebooks
Stars: ✭ 229 (-72.34%)
Mutual labels:  artificial-intelligence, reinforcement-learning, deep-reinforcement-learning
Text summurization abstractive methods
Multiple implementations for abstractive text summurization , using google colab
Stars: ✭ 359 (-56.64%)
Mutual labels:  artificial-intelligence, ai, reinforcement-learning
Basic reinforcement learning
An introductory series to Reinforcement Learning (RL) with comprehensive step-by-step tutorials.
Stars: ✭ 826 (-0.24%)
Mutual labels:  artificial-intelligence, ai, reinforcement-learning
Holodeck
High Fidelity Simulator for Reinforcement Learning and Robotics Research.
Stars: ✭ 513 (-38.04%)
Mutual labels:  ai, research, reinforcement-learning
Commandcenter
Starcraft AI Bot
Stars: ✭ 456 (-44.93%)
Mutual labels:  artificial-intelligence, ai, game

PyGame-Learning-Environment

Games

PyGame Learning Environment (PLE) is a learning environment, mimicking the Arcade Learning Environment interface, allowing a quick start to Reinforcement Learning in Python. The goal of PLE is allow practitioners to focus design of models and experiments instead of environment design.

PLE hopes to eventually build an expansive library of games.

Accepting PRs for games.

Documentation

Docs for the project can be found here. They are currently WIP.

Games

Available games can be found in the docs.

Getting started

A PLE instance requires a game exposing a set of control methods. To see the required methods look at ple/games/base.py.

Here's an example of importing Pong from the games library within PLE:

from ple.games.pong import Pong

game = Pong()

Next we configure and initialize PLE:

from ple import PLE

p = PLE(game, fps=30, display_screen=True, force_fps=False)
p.init()

The options above instruct PLE to display the game screen, with display_screen, while allowing PyGame to select the appropriate delay timing between frames to ensure 30fps with force_fps.

You are free to use any agent with the PLE. Below we create a fictional agent and grab the valid actions:

myAgent = MyAgent(p.getActionSet())

We can now have our agent, with the help of PLE, interact with the game over a certain number of frames:

nb_frames = 1000
reward = 0.0

for f in range(nb_frames):
	if p.game_over(): #check if the game is over
		p.reset_game()

	obs = p.getScreenRGB()
	action = myAgent.pickAction(reward, obs)
	reward = p.act(action)

Just like that we have our agent interacting with our game environment.

Installation

PLE requires the following dependencies:

  • numpy
  • pygame
  • pillow

Clone the repo and install with pip.

git clone https://github.com/ntasfi/PyGame-Learning-Environment.git
cd PyGame-Learning-Environment/
pip install -e .

Headless Usage

Set the following in your code before usage:

os.putenv('SDL_VIDEODRIVER', 'fbcon')
os.environ["SDL_VIDEODRIVER"] = "dummy"

Thanks to @wooridle.

Updating

cd into the PyGame-Learning-Environment directory and run the following:

git pull

Todos

  • Documentation is currently in progress.
  • Tests
  • Parallel Learning (One agent, many game copies)
  • Add games
  • Generalize the library (eg. add Pyglet support)

Citing PLE

If PLE has helped your research please cite it in your publications. Example BibTeX entry:

@misc{tasfi2016PLE,
  author = {Tasfi, Norman},
  title = {PyGame Learning Environment},
  year = {2016},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/ntasfi/PyGame-Learning-Environment}}
}
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].