gymz provides a light-weight wrapper for the OpenAI Gym to allow interaction with reinforcement-learning environments via ZeroMQ sockets.
The wrapper consists of four different threads that coordinate
- performing steps in an environment
- receiving actions via a ZeroMQ SUB socket
- publishing observations via a ZeroMQ PUB socket
- publishing rewards via a ZeroMQ PUB socket
It was initially designed to be used in combination with MUSIC enabling online interaction between reinforcement learning environments from the OpenAI Gym and neuronal network models in simulators like NEST or NEURON.
gymz is available via pip:
pip install gymz
An example client is provided (examples/random_gymz_client.py
) that connects to a running instance of the wrapper, sends random actions and prints observations and rewards received from the environment to the screen. From a terminal start the wrapper with the default configuration file:
gymz-controller gym DefaultConfig.json
and the MountainCar-v0
environment should be rendered on the screen. Afterwards start the client with:
python random_gymz_client.py
The client should now continously print commands, observations and rewards to the terminal. If it does not, please report the issue.
gymz is in a fairly early development stage and should be used with care. Please report any unexpected behaviour you encounter and do not hesitate to create PRs.