All Projects → deepmind → Spriteworld

deepmind / Spriteworld

Licence: apache-2.0
Spriteworld: a flexible, configurable python-based reinforcement learning environment

Programming Languages

python
139335 projects - #7 most used programming language
procedural
45 projects

Projects that are alternatives of or similar to Spriteworld

Rlenv.directory
Explore and find reinforcement learning environments in a list of 150+ open source environments.
Stars: ✭ 79 (-76.56%)
Mutual labels:  environment, rl
Learning To Communicate Pytorch
Learning to Communicate with Deep Multi-Agent Reinforcement Learning in PyTorch
Stars: ✭ 236 (-29.97%)
Mutual labels:  rl, deepmind
Lando
A development tool for all your projects that is fast, easy, powerful and liberating
Stars: ✭ 3,142 (+832.34%)
Mutual labels:  environment
Ikonate
Fully customisable & accessible vector icons
Stars: ✭ 3,392 (+906.53%)
Mutual labels:  sprites
Mbtileparser
MBTileParser is a game engine written using pure UIKit in the days before SpriteKit.
Stars: ✭ 297 (-11.87%)
Mutual labels:  sprites
Matterport3dsimulator
AI Research Platform for Reinforcement Learning from Real Panoramic Images.
Stars: ✭ 260 (-22.85%)
Mutual labels:  rl
Elf
ELF: a platform for game research with AlphaGoZero/AlphaZero reimplementation
Stars: ✭ 3,240 (+861.42%)
Mutual labels:  rl
idealingua-v1
IdeaLingua RPC for Scala, TypeScript, C#, Go
Stars: ✭ 13 (-96.14%)
Mutual labels:  generative
Deep Learning
深度学习/人工智能/机器学习资料汇总(Deep Learning/Artificial Intelligent/Machine Learning) 持续更新……
Stars: ✭ 329 (-2.37%)
Mutual labels:  deepmind
Generative Query Network Pytorch
Generative Query Network (GQN) in PyTorch as described in "Neural Scene Representation and Rendering"
Stars: ✭ 294 (-12.76%)
Mutual labels:  deepmind
Dotfiles
My OS X environment
Stars: ✭ 316 (-6.23%)
Mutual labels:  environment
Alphagozero Python Tensorflow
Congratulation to DeepMind! This is a reengineering implementation (on behalf of many other git repo in /support/) of DeepMind's Oct19th publication: [Mastering the Game of Go without Human Knowledge]. The supervised learning approach is more practical for individuals. (This repository has single purpose of education only)
Stars: ✭ 292 (-13.35%)
Mutual labels:  deepmind
Opennars
OpenNARS for Research 3.0+
Stars: ✭ 264 (-21.66%)
Mutual labels:  rl
G
Simple go version manager, gluten-free
Stars: ✭ 307 (-8.9%)
Mutual labels:  environment
Sand Spline
generative algorithm
Stars: ✭ 261 (-22.55%)
Mutual labels:  generative
Generativeart
Generative Art in Go
Stars: ✭ 313 (-7.12%)
Mutual labels:  generative
Gym Gazebo2
gym-gazebo2 is a toolkit for developing and comparing reinforcement learning algorithms using ROS 2 and Gazebo
Stars: ✭ 257 (-23.74%)
Mutual labels:  rl
Drq
DrQ: Data regularized Q
Stars: ✭ 268 (-20.47%)
Mutual labels:  rl
Aframe Environment Component
🌄 Infinite background environments for A-Frame in a line of HTML.
Stars: ✭ 300 (-10.98%)
Mutual labels:  environment
Irl Imitation
Implementation of Inverse Reinforcement Learning (IRL) algorithms in python/Tensorflow. Deep MaxEnt, MaxEnt, LPIRL
Stars: ✭ 333 (-1.19%)
Mutual labels:  rl

Spriteworld: A Flexible, Configurable Reinforcement Learning Environment

Description

Spriteworld is a python-based RL environment that consists of a 2-dimensional arena with simple shapes that can be moved freely. This environment was developed for the COBRA agent introduced in the paper "COBRA: Data-Efficient Model-Based RL through Unsupervised Object Discovery and Curiosity-Driven Exploration" (Watters et al., 2019). The motivation for the environment was to provide as much flexibility for procedurally generating multi-object scenes while retaining as simple an interface as possible.

Spriteworld sprites come in a variety of shapes and can vary continuously in position, size, color, angle, and velocity. The environment has occlusion but no physics, so by default sprites pass beneath each other but do not collide or interact in any way. Interactions may be introduced through the action space, which can update all sprites each timestep. For example, the DiscreteEmbodied action space (see spriteworld/action_spaces.py) implements a rudimentary form of physics in which an agent's body sprite can adhere to and carry sprites underneath it.

There are a variety of action spaces, some of which are continuous (like a touch-screen) and others of which are discrete (like an embodied agent that takes discrete steps).

Example Tasks

Below are three of the tasks used in the COBRA paper.

Goal-finding task. The agent must bring the target sprites (squares) to the center of the arena.

goal_finding_video

Clustering task. The agent must arrange the sprites into clusters according to their color.

clustering_video

Sorting task. The agent must sort the sprites into goal locations according to their color (each color is associated with a different goal location).

sorting_video

Installation

Spriteworld can be installed using pip:

pip install spriteworld

Or through Github:

pip install git+https://github.com/deepmind/spriteworld.git

or alternatively by checking out a local copy of our repository and running:

git clone https://github.com/deepmind/spriteworld.git
pip install spriteworld/

This last option additionally downloads tests, the demo UI and an example run loop.

Getting Started

Prerequisites

Spriteworld depends on numpy, six, absl, PIL, matplotlib, sklearn, and dm_env.

Running The Demo

Once installed, you may familiarize yourself with Spriteworld through run_demo.py:

python /path/to/local/spriteworld/run_demo.py

This will run a cluster-by-color task with a drag-and-drop action space. There are a number of tasks specified in the spriteworld/configs directory, each of which can be run with the demo by modifying the --config flag. Note that some tasks (namely spriteworld.configs.examples.goal_finding_embodied) use an embodied agent instead of the drag-and-drop action space.

Creating Your Own Task

In spriteworld/tasks.py are three tasks: FindGoalPosition, Clustering, and MetaAggregated. These can be configured and combined in numerous ways to create a wide variety of tasks, including all of those used in the COBRA paper. In particular, see spriteworld/configs/cobra/sorting.py for a non-trivial combination of goal-finding tasks.

You may create new tasks be re-using these building blocks, or creating entirely new types of tasks (just be sure to inherit from spriteworld/tasks.AbstractTask).

Running An Agent

See example_run_loop.py for an example of how to run a random agent on a Spriteworld task. See spriteworld/gym_wrapper.py if you prefer the OpenAI Gym environment interface.

Additional Use-Cases

Spriteworld can be used for purposes other than reinforcement learning. For example, it was used to generate the image datasets with controlled factor distributions presented in the paper "Spatial Broadcast Decoder: A Simple Architecture for Learning Disentangled Representations in VAEs" (Watters et al., 2019). It can also be easily extended to generate datasets of objects interacting with simple physical forces (e.g. spring, gravity, etc.), which are useful for research in unsupervised learning of visual dynamics.

Reference

If you use this library in your work, please cite it as follows:

@misc{spriteworld19,
author = {Nicholas Watters and Loic Matthey and Sebastian Borgeaud and Rishabh Kabra and Alexander Lerchner},
title = {Spriteworld: A Flexible, Configurable Reinforcement Learning Environment},
howpublished = {https://github.com/deepmind/spriteworld/},
url = {https://github.com/deepmind/spriteworld/},
year = "2019",
}

Disclaimers

This is not an officially supported Google product.

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