{ "info": { "author": "OpenAI", "author_email": "universe@openai.com", "bugtrack_url": null, "classifiers": [], "description": "universe\n***************\n\n.. image:: https://travis-ci.org/openai/universe.svg?branch=master\n :target: https://travis-ci.org/openai/universe\n\n`Universe `_ is a software\nplatform for measuring and training an AI's general intelligence\nacross the world's supply of games, websites and other\napplications. This is the ``universe`` open-source library, which\nprovides a simple `Gym `__\ninterface to each Universe environment.\n\nUniverse allows anyone to train and evaluate AI agents on an extremely\nwide range of real-time, complex environments.\n\nUniverse makes it possible for any existing program to become an\nOpenAI Gym environment, without needing special access to the\nprogram's internals, source code, or APIs. It does this by packaging\nthe program into a Docker container, and presenting the AI with the\nsame interface a human uses: sending keyboard and mouse events, and\nreceiving screen pixels. Our initial release contains over 1,000\nenvironments in which an AI agent can take actions and gather\nobservations.\n\nAdditionally, some environments include a reward signal sent to the\nagent, to guide reinforcement learning. We've included a few hundred\nenvironments with reward signals. These environments also include\nautomated start menu clickthroughs, allowing your agent to skip to the\ninteresting part of the environment.\n\nWe'd like the community's `help `_\nto grow the number of available environments, including integrating\nincreasingly large and complex games.\n\nThe following classes of tasks are packaged inside of\npublicly-available Docker containers, and can be run today with no\nwork on your part:\n\n- Atari and CartPole environments over VNC: ``gym-core.Pong-v3``, ``gym-core.CartPole-v0``, etc.\n- Flashgames over VNC: ``flashgames.DuskDrive-v0``, etc.\n- Browser tasks (\"World of Bits\") over VNC: ``wob.mini.TicTacToe-v0``, etc.\n\nWe've scoped out integrations for many other games, including\ncompleting a high-quality GTA V integration (thanks to `Craig Quiter `_ and NVIDIA), but these aren't included in today's release.\n\n.. contents:: **Contents of this document**\n :depth: 2\n\n\nGetting started\n===============\n\nInstallation\n------------\n\nSupported systems\n~~~~~~~~~~~~~~~~~\n\nWe currently support Linux and OSX running Python 2.7 or 3.5.\n\nWe recommend setting up a `conda environment `__\nbefore getting started, to keep all your Universe-related packages in the same place.\n\nInstall Universe\n~~~~~~~~~~~~~~~~\nTo get started, first install ``universe``:\n\n.. code:: shell\n\n git clone https://github.com/openai/universe.git\n cd universe\n pip install -e .\n\nIf this errors out, you may be missing some required packages. Here's\nthe list of required packages we know about so far (please let us know\nif you had to install any others).\n\nOn Ubuntu 16.04:\n\n.. code:: shell\n\n pip install numpy\n sudo apt-get install golang libjpeg-turbo8-dev make\n\nOn Ubuntu 14.04:\n\n.. code:: shell\n\n sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable # for newer golang\n sudo apt-get update\n sudo apt-get install golang libjpeg-turbo8-dev make\n\nOn OSX:\n\nYou might need to install Command Line Tools by running:\n\n.. code:: shell\n\n xcode-select --install\n\nOr ``numpy``, ``libjpeg-turbo`` and ``incremental`` packages:\n\n.. code:: shell\n\n pip install numpy incremental\n brew install golang libjpeg-turbo\n\nInstall Docker\n~~~~~~~~~~~~~~\n\nThe majority of the environments in Universe run inside Docker\ncontainers, so you will need to `install Docker\n`__ (on OSX, we\nrecommend `Docker for Mac\n`__). You should be able to\nrun ``docker ps`` and get something like this:\n\n.. code:: shell\n\n $ docker ps\n CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n\nNotes on installation\n~~~~~~~~~~~~~~~~~~~~~\n\n* When installing ``universe``, you may see ``warning`` messages. These lines occur when installing numpy and are normal.\n* You'll need a ``go version`` of at least 1.5. Ubuntu 14.04 has an older Go, so you'll need to `upgrade `_ your Go installation.\n* We run Python 3.5 internally, so the Python 3.5 variants will be much more thoroughly performance tested. Please let us know if you see any issues on 2.7.\n* While we don't officially support Windows, we expect our code to be very close to working there. We'd be happy to take pull requests that take our Windows compatibility to 100%.\n\nSystem overview\n---------------\n\nA Universe **environment** is similar to any other Gym environment:\nthe agent submits actions and receives observations using the ``step()``\nmethod.\n\nInternally, a Universe environment consists of two pieces: a **client** and a **remote**:\n\n* The **client** is a `VNCEnv\n `_\n instance which lives in the same process as the agent. It performs\n functions like receiving the agent's actions, proxying them to the\n **remote**, queuing up rewards for the agent, and maintaining a\n local view of the current episode state.\n* The **remote** is the running environment dynamics, usually a\n program running inside of a Docker container. It can run anywhere --\n locally, on a remote server, or in the cloud. (We have a separate\n page describing how to manage `remotes `__.)\n* The client and the remote communicate with one another using the\n `VNC `__\n remote desktop system, as well as over an auxiliary WebSocket\n channel for reward, diagnostic, and control messages. (For more\n information on client-remote communication, see the separate page on\n the `Universe internal communication protocols\n `__.)\n\nThe code in this repository corresponds to the **client** side of the\nUniverse environments. Additionally, you can freely access the Docker\nimages for the **remotes**. We'll release the source repositories for\nthe remotes in the future, along with tools to enable users to\nintegrate new environments. Please sign up for our `beta\n`_\nif you'd like early access.\n\nRun your first agent\n--------------------\n\nNow that you've installed the ``universe`` library, you should make\nsure it actually works. You can paste the example below into your\n``python`` REPL. (You may need to press enter an extra time to make\nsure the ``while`` loop is executing.)\n\n.. code:: python\n\n import gym\n import universe # register the universe environments\n\n env = gym.make('flashgames.DuskDrive-v0')\n env.configure(remotes=1) # automatically creates a local docker container\n observation_n = env.reset()\n\n while True:\n action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n] # your agent here\n observation_n, reward_n, done_n, info = env.step(action_n)\n env.render()\n\nThe example will instantiate a client in your Python process,\nautomatically pull the ``quay.io/openai/universe.flashgames`` image,\nand will start that image as the remote. (In our `remotes\n`__ documentation page, we explain other ways you can run\nremotes.)\n\nIt will take a few minutes for the image to pull the first time. After that,\nif all goes well, a window like the one below will soon pop up. Your\nagent, which is just pressing the up arrow repeatedly, is now\nplaying a Flash racing game called `Dusk Drive\n`__. Your agent\nis programmatically controlling a VNC client, connected to a VNC\nserver running inside of a Docker container in the cloud, rendering a\nheadless Chrome with Flash enabled:\n\n.. image:: https://github.com/openai/universe/blob/master/doc/dusk-drive.png?raw=true\n :width: 600px\n\nYou can even connect your own VNC client to the environment, either\njust to observe or to interfere with your agent. Our ``flashgames``\nand ``gym-core`` images conveniently bundle a browser-based VNC\nclient, which can be accessed at\n``http://localhost:15900/viewer/?password=openai``. If you're on Mac,\nconnecting to a VNC server is as easy as running: ``open\nvnc://localhost:5900``.\n\n(If using docker-machine, you'll need to replace \"localhost\" with the\nIP address of your Docker daemon, and use ``openai`` as the password.)\n\nBreaking down the example\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSo we managed to run an agent, what did all the code actually\nmean? We'll go line-by-line through the example.\n\n* First, we import the `gym `__ library,\n which is the base on which Universe is built. We also import\n ``universe``, which `registers\n `__\n all the Universe environments.\n\n.. code:: python\n\n import gym\n import universe # register the universe environments\n\n* Next, we create the environment instance. Behind the scenes, ``gym``\n looks up the `registration\n `__\n for ``flashgames.DuskDrive-v0``, and instantiates a `VNCEnv\n `__\n object which has been `wrapped\n `__\n to add a few useful diagnostics and utilities. The ``VNCEnv`` object\n is the *client* part of the environment, and it is not yet connected\n to a *remote*.\n\n.. code:: python\n\n env = gym.make('flashgames.DuskDrive-v0')\n\n* The call to ``configure()`` connects the client to a remote\n environment server. When called with ``configure(remotes=1)``,\n Universe will automatically create a Docker image running locally on\n your computer. The local client connects to the remote using VNC.\n (More information on client-remote communication can be found in the\n page on `universe internal communication protocols\n `__. More on configuring remotes is at `remotes `__.)\n\n.. code:: python\n\n env.configure(remotes=1)\n\n* When starting a new environment, you call ``env.reset()``. Universe\n environments run in real-time, rather than stepping synchronously\n with the agent's actions, so ``reset`` is asynchronous and returns\n immediately. Since the environment will not have waited to finish\n connecting to the VNC server before returning, the initial observations\n from ``reset`` will be ``None`` to indicate that there is\n not yet a valid observation.\n\n Similarly, the environment keeps running in the background even\n if the agent does not call ``env.step()``. This means that an agent\n that successfully learns from a Universe environment cannot take\n \"thinking breaks\": it must keep sending actions to the environment at all times.\n\n Additionally, Universe introduces the *vectorized* Gym\n API. Rather than controlling a single environment at a time, the agent\n can control a fixed-size vector of ``n`` environments, each with its\n own remote. The return value from ``reset`` is therefore a *vector*\n of observations. For more information, see the separate page on\n `environment semantics `__)\n\n.. code:: python\n\n observation_n = env.reset()\n\n* At each ``step()`` call, the agent submits a vector of actions; one for\n each environment instance it is controlling. Each VNC action is a\n list of events; above, each action is the single event \"press the\n ``ArrowUp`` key\". The agent could press and release the key in one\n action by instead submitting ``[('KeyEvent', 'ArrowUp', True),\n ('KeyEvent', 'ArrowUp', False)]`` for each observation.\n\n In fact, the agent could largely have the same effect by just\n submitting ``('KeyEvent', 'ArrowUp', True)`` once and then calling\n ``env.step([[] for ob in observation_n])`` thereafter, without ever\n releasing the key using ``('KeyEvent', 'ArrowUp', False)``. The\n browser running inside the remote would continue to statefully\n represent the arrow key as being pressed. Sending other unrelated\n keypresses would not disrupt the up arrow keypress; only explicitly\n releasing the key would cancel it. There's one slight subtlety:\n when the episode resets, the browser will reset, and will forget\n about the keypress; you'd need to submit a new ``ArrowUp`` at the\n start of each episode.\n\n.. code:: python\n\n action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]\n\n* After we submit the action to the environment and render one frame,\n ``step()`` returns a list of *observations*, a list of *rewards*, a\n list of *\"done\" booleans* indicating whether the episode has ended,\n and then finally an *info dictionary* of the form ``{'n': [{},\n ...]}``, in which you can access the info for environment ``i`` as\n ``info['n'][i]``.\n\n Each environment's ``info`` message contains useful diagnostic\n information, including latency data, client and remote timings,\n VNC update counts, and reward message counts.\n\n.. code:: python\n\n observation_n, reward_n, done_n, info = env.step(action_n)\n env.render()\n\n* We call ``step`` in what looks like a busy loop. In reality, there\n is a `Throttle\n `__\n wrapper on the client which defaults to a target frame rate of 60fps, or one\n frame every 16.7ms. If you call it more frequently than that,\n ``step`` will `sleep\n `__\n with any leftover time.\n\n\nTesting\n=======\n\nWe are using `pytest `__ for tests. You can run them via:\n\n.. code:: shell\n\n pytest\n\nRun ``pytest --help`` for useful options, such as ``pytest -s`` (disables output capture) or ``pytest -k `` (runs only specific tests).\n\nAdditional documentation\n========================\n\nMore documentation not covered in this README can be found in the\n`doc folder `__ of this repository.\n\nGetting help\n============\n\nIf you encounter a problem that is not addressed in this README page\nor in the `extra docs `__, then try our wiki page of `solutions\nto common problems\n`__ -\nand add to it if your solution isn't there!\n\nYou can also search through the `issues\n`__\non this repository and our `discussion board\n`__ to see if another user has posted\nabout the same problem or to ask for help from the community.\n\nIf you still can't solve your problem after trying all of the above\nsteps, please post an issue on this repository.\n\nWhat's next?\n============\n\n* Get started training RL algorithms! You can try out the `Universe Starter Agent `_, an implementation of the `A3C algorithm `_ that can solve several VNC environments.\n\n* For more information on how to manage remotes, see the separate documentation page on `remotes `__.\n\n* Sign up for a `beta `_ to get early access to upcoming Universe releases, such as tools to integrate new Universe environments or a dataset of recorded human demonstrations.\n\n\nChangelog\n---------\n- 2017-02-08: The old location for wrappers.SafeActionSpace has been moved to wrappers.experimental.SafeActionSpace. SoftmaxClickMouse has also been moved to wrappers.experimental.SoftmaxClickMouse\n- 2017-01-08: The wrappers.SafeActionSpace has been moved to wrappers.experimental.SafeActionSpace. The old location will remain with a deprecation warning until 2017-02-08.\n- 2016-12-27: BACKWARDS INCOMPATIBILITY: The gym monitor is now a\n wrapper. Rather than starting monitoring as\n `env.monitor.start(directory)`, envs are now wrapped as follows:\n `env = wrappers.Monitor(env, directory)`. This change is on master\n and will be released with 0.21.0.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/openai/universe", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "universe", "package_url": "https://pypi.org/project/universe/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/universe/", "project_urls": { "Homepage": "https://github.com/openai/universe" }, "release_url": "https://pypi.org/project/universe/0.21.3/", "requires_dist": null, "requires_python": "", "summary": "Universe: a software platform for measuring and training an AI's general intelligence across the world's supply of games, websites and other applications.", "version": "0.21.3" }, "last_serial": 2684611, "releases": { "0.20.1": [ { "comment_text": "", "digests": { "md5": "bd33eba1225dd52793cd980449b3f682", "sha256": "7fe08bd510a9a4f8315132050e5c0b377277d9a8306df4ff5779048f88498fca" }, "downloads": -1, "filename": "universe-0.20.1.tar.gz", "has_sig": false, "md5_digest": "bd33eba1225dd52793cd980449b3f682", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128864, "upload_time": "2016-12-05T05:57:59", "url": "https://files.pythonhosted.org/packages/63/e4/15187e506e59cfeee21b46541ed14593a644f58410dc7d133dbe462b5072/universe-0.20.1.tar.gz" } ], "0.20.2": [ { "comment_text": "", "digests": { "md5": "ebfc2cfc761407f5ea5dcf3645079eaf", "sha256": "4c8afd65944c7b4d943be6554ff38940cbd6631dcd2e642e8f7140ee2d742148" }, "downloads": -1, "filename": "universe-0.20.2.tar.gz", "has_sig": false, "md5_digest": "ebfc2cfc761407f5ea5dcf3645079eaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128841, "upload_time": "2016-12-05T06:17:17", "url": "https://files.pythonhosted.org/packages/4c/4d/341e06ec7ef3c1efdc6c16e94cebc4b3cff5857bd9c55520fae14781f5ea/universe-0.20.2.tar.gz" } ], "0.20.3": [ { "comment_text": "", "digests": { "md5": "8f99977f53742f41749fd6504974e864", "sha256": "b5c2dba5a5c5de0532a91fcbe16a6f21e59bb6450cc9ff21d3ebc85700a122de" }, "downloads": -1, "filename": "universe-0.20.3.tar.gz", "has_sig": false, "md5_digest": "8f99977f53742f41749fd6504974e864", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128859, "upload_time": "2016-12-06T19:41:34", "url": "https://files.pythonhosted.org/packages/72/3a/91f7fd85861fe78ba3971d451ce3e674c4bc3873954a0b978f5924c6a588/universe-0.20.3.tar.gz" } ], "0.20.4": [ { "comment_text": "", "digests": { "md5": "a16925b01dd5610a96307ae07d43694d", "sha256": "58fdcf9470d2585b96cd7bdca258d06ed2ba43f9b88c97a89a00178dcb74e166" }, "downloads": -1, "filename": "universe-0.20.4.tar.gz", "has_sig": false, "md5_digest": "a16925b01dd5610a96307ae07d43694d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128345, "upload_time": "2016-12-09T04:18:58", "url": "https://files.pythonhosted.org/packages/60/be/5136f273e1057f5928c25963f21d45002530930a07a185abf921903bd7af/universe-0.20.4.tar.gz" } ], "0.21.0": [ { "comment_text": "", "digests": { "md5": "600c681a0ad1e56ceb8767bc576bb6a9", "sha256": "40f5186a61f51431895eb7e8b31192785b96bcb52ea5ccb3275c408b84d72163" }, "downloads": -1, "filename": "universe-0.21.0.tar.gz", "has_sig": false, "md5_digest": "600c681a0ad1e56ceb8767bc576bb6a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 131149, "upload_time": "2016-12-24T03:15:28", "url": "https://files.pythonhosted.org/packages/16/33/671fdf8981aab96dbb33011da03095c13c0694c91e328b3accc06ff32913/universe-0.21.0.tar.gz" } ], "0.21.1": [ { "comment_text": "", "digests": { "md5": "29eb1fd33e8c5f98d7ff5790f4daf2aa", "sha256": "b880a80dd2384a5372f746849e458de74bebf680acb2dc6ba2644cf51ebb856f" }, "downloads": -1, "filename": "universe-0.21.1.tar.gz", "has_sig": false, "md5_digest": "29eb1fd33e8c5f98d7ff5790f4daf2aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132043, "upload_time": "2017-01-05T18:25:58", "url": "https://files.pythonhosted.org/packages/00/dd/d036911df74524c7a258590546cb41a8bd38d0180416755e70308b359459/universe-0.21.1.tar.gz" } ], "0.21.2": [ { "comment_text": "", "digests": { "md5": "ae9970faffa20b101068d771e0be2405", "sha256": "afca2d929b8cd453d2a3ce5c1bc866b99cbc2a2e4131391af3c9ef6f055fd7cf" }, "downloads": -1, "filename": "universe-0.21.2.tar.gz", "has_sig": false, "md5_digest": "ae9970faffa20b101068d771e0be2405", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 133975, "upload_time": "2017-01-12T01:49:08", "url": "https://files.pythonhosted.org/packages/df/6a/69740da80e743db5810f90a8116baedc6ab314706d03fe47c83aee8c140b/universe-0.21.2.tar.gz" } ], "0.21.3": [ { "comment_text": "", "digests": { "md5": "a6df6fc3179e75d3011fc3a7660188a6", "sha256": "9fc9835b3d2fe787fd2fd6079696eb1de40ca1f6f0e8246427b11fadd856640f" }, "downloads": -1, "filename": "universe-0.21.3.tar.gz", "has_sig": false, "md5_digest": "a6df6fc3179e75d3011fc3a7660188a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 136998, "upload_time": "2017-03-05T22:23:32", "url": "https://files.pythonhosted.org/packages/5b/5e/26ee56c16cdc83a07a3251e3425856f2ade84928de55b3fa11590ce2b912/universe-0.21.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6df6fc3179e75d3011fc3a7660188a6", "sha256": "9fc9835b3d2fe787fd2fd6079696eb1de40ca1f6f0e8246427b11fadd856640f" }, "downloads": -1, "filename": "universe-0.21.3.tar.gz", "has_sig": false, "md5_digest": "a6df6fc3179e75d3011fc3a7660188a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 136998, "upload_time": "2017-03-05T22:23:32", "url": "https://files.pythonhosted.org/packages/5b/5e/26ee56c16cdc83a07a3251e3425856f2ade84928de55b3fa11590ce2b912/universe-0.21.3.tar.gz" } ] }