Skip to main content

A tool to help train RL agents in novel environments.

Project description

Polycraft AI Lab (PAL)

A tool to help train reinforcement learning models to handle novel environments.

About

Polycraft AI Lab consists of a wrapper for Polycraft World game environments. These environments can used to train RL models that respond to novel tasks and scenarios.

Usage

1a. Install via package

First, download Polycraft AI Lab using pip:

pip install polycraft-lab

This downloads the polycraft-lab package from pip, which contains tools to easily set up and manage the Polycraft game client.

To install the most recent changes (experimental version):

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ polycraft-lab

1b. Local Installation

Alternatively, to install the latest version from source:

git clone https://github.com/PolycraftWorld/polycraft-ai-lab
pip install ./polycraft-ai-lab

If you installed PAL using method (1a), this isn't required.

2. Import and Use

Now train your agent like you would do with any other gym-style environment:

from polycraft_lab.envs.helpers import setup_env

env = setup_env('pogo_stick')
observation = env.reset()
for _ in range(1000):
    env.render()
    action = env.action_space.sample() # your agent here (this takes random actions)
    observation, reward, done, info = env.step(action)

    if done:
        observation = env.reset()
env.close()

Polycraft AI Lab also contains a wrapper [WIP] to start experiment creation from the command line. The following begins the experiment creation process by launching Minecraft:

python -m polycraft_lab.ect --create EXPERIMENT_NAME --launch

Running python -m polycraft_lab.ect --create EXPERIMENT_NAME will allow you to create simpler experiments, allowing configuration of more high-level domain attributes, like action space and a preconfigured goal, such as finding diamonds as quickly as possible.

Development

Clone out the repository:

git clone https://github.com/PolycraftWorld/polycraft-ai-lab.git

Optionally, you can create a virtual environment to store dependencies.

In any case, install the dependencies:

pip install -r requirements.txt

Alternatively, a virtual environment can be created with the necessary dependencies by running:

cd polycraft-ai-lab
pipenv install

Distribution

Polycraft AI Lab will be distributed using pip.

The easy way to upload to upload to the test PyPI index:

./release.sh

To release to the live PyPI index:

./release.sh --release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polycraft-lab-0.1.0a0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polycraft_lab-0.1.0a0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file polycraft-lab-0.1.0a0.tar.gz.

File metadata

  • Download URL: polycraft-lab-0.1.0a0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for polycraft-lab-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 79061c3f5b7056ca597e345ed0bbfd5f9214e6c20c9bff562cd9c03a036597d8
MD5 dbd6a68fdb0211e970e1ec7329989a19
BLAKE2b-256 77400b75aaad8a2bcfaa58c4292934a78c99010bea4ea46e11436954442f02a1

See more details on using hashes here.

File details

Details for the file polycraft_lab-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: polycraft_lab-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5

File hashes

Hashes for polycraft_lab-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee37dc865a61fee58aa7f6c2db0e1aa68040a5f3fc6385ef0aa2f85224e336c
MD5 f77d3861f5c07b8e6aade3c60a21fc7b
BLAKE2b-256 4ccdd274c80f241f37bc40c9f4110a7d3037f094e7a1b7f72fe996ffc80a8fd1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page