Skip to main content

Simple multiprocess tool for gym environments

Project description

VectorGym

Multi-process any(most) gym environment. Automatically parallel the given gym environment using multiprocessing; VectorGym forwards all properties and function (not starting with __) of the underlying gym to you.

Quick Start

Check this demo for a skeleton for training using VectorSim. It deals with only running unfinished environments during trajectory collection.

Run gym environment in parallel.

from VectorGym import VectorGym

if __name__ == '__main__':
    envs = VectorGym('CartPole-v1', 2)

    print(envs.action_space)
    print(envs.observation_space)

    envs.reset()

    for _ in range(500):
        envs.render()
        actions = envs.action_space.sample()
        res = envs.step(actions)
        dones = [r[-2] for r in res]

        envs.reset(select=dones)

    envs.close()

Install

git clone git@github.com:MRzNone/VectorGym.git
cd VectorGym
pip install -e .

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

VectorGym-0.1.2.linux-x86_64.tar.gz (9.2 kB view details)

Uploaded Source

File details

Details for the file VectorGym-0.1.2.linux-x86_64.tar.gz.

File metadata

  • Download URL: VectorGym-0.1.2.linux-x86_64.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5

File hashes

Hashes for VectorGym-0.1.2.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 f285972933b24519a37d7a5aa4057c33dbbb750d5d533f37b578453679650fae
MD5 0f2f3df82e241872d0de5c162d61e486
BLAKE2b-256 89a7f1c59034ceb8fa9816f8e53c2b2aa954a4b36db6fd4724de0c90f53500e6

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