![]() |
ReLab v1.0.0-b
Reinforcement Learning Benchmarks
|
ReLab is a powerful and user-friendly library designed to streamline reinforcement learning experiments. With a curated collection of well-known RL agents and seamless integration with Gym environments, ReLab empowers you to train agents effortlessly, visualize their learned behaviors, and compare their performance across diverse metrics. Whether you're a researcher exploring state-of-the-art algorithms or a practitioner fine-tuning agents for real-world applications, ReLab simplifies the process, saving you time and effort.
Linux, macOS, Windows (WSL):
Windows (Powershell)
Clone the ReLab repository:
Install ReLab's package and its dependencies inside a virtual environment:
Check that the installation was successful:
ReLab provides a collection of well-known reinforcement learning agents and enables you to train them on any Gym environment. You can then visualize the learned policies and compare the performance of various agents. Before proceeding with the following sections, make sure that ReLab is installed and activate the virtual environment using the following command:
An agent can be trained by running the following command:
The training script accepts three parameters:
--agent
specifies the reinforcement learning agent to train,--env
defines the environment in which the agent will be trained, and--seed
sets the random seed to ensure reproducibility.As the agent is learning, you can visualize its performance using the following command:
This will open a graphical interface at http://localhost:6006/, allowing you to monitor:
By default, ReLab saves the learned policy every 500,000 training iterations. Once an agent has been trained, you can visualize its learned policy using the following command:
These parameters should look familiar, as they are identical to those used in the training script. By default, ReLab demonstrates the latest policy. However, you can specify a particular model checkpoint using the following command:
Here, the --index
parameter allows you to select the policy learned by the agent after 1,000,000 training iterations. After running the above command, ReLab will generate a GIF of the agent's behavior, which can be found in:
ReLab also provides a script to generate graphs summarizing the agent performance:
Importantly, the parameters --agents
and --seeds
are now plural because the script accepts a list of agents and seeds. The --metric
parameter allows you to compare agents based on various metrics, such as episodic mean reward, training speed, or memory usage. This script can also be used to compare multiple agents across different seeds, as shown below:
When multiple seeds are provided, the graph will display a solid line representing the average metric, along with a shaded area indicating the metric's standard deviation.
For a deeper dive into advanced use cases of ReLab and additional examples, check out our In-Depth Tutorial.
Please let us know if you encounter a bug by filing an issue.
ReLab follows a "fork and pull request" workflow. If you are planning to contribute, you must:
ReLab is still in beta. The latest version of ReLab is version 1.0.0-b.
ReLab has a MIT license, as found in the license file.