Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Ludus

Ludus is a reinforcement learning library for expediating development of RL applications and research. Ludus is still in an alpha development stage, so new algorithms and models are continuously being added with the growth of the framework. You can find many state-of-the-art algorithms implemented and ready to use. Additionly, the platform has ready to go integration with popular training environments like OpenAI's gym. The high level API of Ludus combined with easily accesible and well documented, open source code allows for both efficiency and control.

Getting Started

These instructions will help you quickly get Ludus up and running, ready for RL application. Ludus is built on Python 3, and there is no gaurantee it will work with Python 2.

Prerequisites

Ludus requires several libraries to get started. Anaconda 3 is recommended as it contains most of the required libraries, as well as many related libraries that may be useful. Nearly all prerequisites are installed when doing the standard pip installation as described below. The exeption is Tensorflow. While GPU enabled Tensorflow is strongly recommended over the CPU version, it is not required. You can find a guide to installing GPU enabled Tensorflow here, and CPU Tensorflow here.

Installing

The recommended method of installation is with the command, pip install ludus.

Alternatively, the package can be installed by cloning the repository and running, pip setup.py install in the root directory of the project.

Your First Ludus Agent

To get started, the vpg_cartpole example steps through the creation and training process for a simple agent. It is recommended that you use the notebook as an initial testing ground, and a template for other agents.

In Ludus, the process of creating an intelligent agent can be divided into 3 major steps. Performing the 1st step, and then repeating steps 2 and 3 in a training loop is the typical program flow:

  1. Creating input networks Depending on the type of trainer you wish to use to train your agent, a variety of different input neural networks may be required. The simplest form of this in Vanilla Policy Gradient (VPG / VPGTrainer), which requires only one network that maps observations to actions. Other, more complex methods like Proximal Policy Optimization (PPO / PPOTrainer) require two networks, one choosing actions and another estimating state values. If you are not familiar with these concepts, It is recommended that you thoroughly looking through the examples, as they are consice and easy to work with.

  2. Environment simulation & data gathering An EnvController instance is created and used to gather data from the environment. By adujsting the n_threads argument to an integer greater than 1, you can run multiple environments in parallel. The sim_episodes function is used to simualte the environment and gather data. Because Ludus handles environment simulation and data collection for you, custom environments can easily be integrated into the environment so long as they conform to a specific format (more on this here). Once data has been gathered through an instance of EnvController, retrieving the data can be done with a get_data() call to the instance.

  3. Training Training one epoch on the data is as simple as calling network.train(ec.get_data()), where network is an instance of a child of BaseTrainer (like VPGTrainer), and ec is an instance of EnvController. After a get_data() call, the training data memory buffer will be reset, unless otherwise in the function parameters.

Using a Custom Game Environemnt

While this feature is supported and easy to implement, the documentation is not yet complete. For the time being, it is recommended that you examine OpenAI's gym. Creating an environment with the same reset, step, and initialization functions (the same input arguments and return values) will work with the Ludus framework.

Built With

  • numpy - Efficient mathematical operations
  • opencv2 - Image manipulation in 2D environments
  • Tensorflow - Creating and training neural networks
  • gym - Envronments for training agents

Documentation

Further, more in depth documentation is in the works, although not ready quite.

Authors

  • Edan Meyer (ejmejm) is currently the lead and only developer for the project.

License

This project is licensed under the MIT License. Please see the attached license file for more details.

Metadata

Release files for ludus 0.1a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ludus 0.1a3
File Size Uploaded
ludus-0.1a3.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ludus 0.1a3
File Interpreter ABI Platform
ludus-0.1a3-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / ludus-0.1a3.tar.gz

Download URL ludus-0.1a3.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a65421b4e0bf8a6154247af10d7a6cbc21bdf4067817e6ed4261ba54efa96e0d
BLAKE2b-256 checksum
How to use checksums
2d914b3715840198190ab3865cb69ea76f57ca152c95f129a241b223b40ba82f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

Release files / ludus-0.1a3-py3-none-any.whl

Download URL ludus-0.1a3-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18118a489cc4361bfab481243e15819cb1a0506d7fcd5ff8daf870d92668764d
BLAKE2b-256 checksum
How to use checksums
9a9d2a5daaf0f32458a623fa37ee8aef44212839d17c1d33d2e5e2858e015daf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.1a3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page