A plotter for reinforcement learning (RL)
Project description
rl-plotter
This is a simple tool which can plot learning curves easily for reinforcement learning (RL).
Installation
from PIP
pip install rl_plotter
from source
python setup.py install
Examples
First, add our logger (compatible with OpenAI-baseline) in your code
or just OpenAI-baseline bench.Monitor (recommended)
from baselines import bench
env = bench.Monitor(env, log_dir)
After the training or when you are training your agent, you can plot the learning curves in this way:
python -m rl_plotter.plotter --save --show
for help use:
python -m rl_plotter.plotter --help
and you can find parameters to custom the style of your curves.
optional arguments:
-h, --help show this help message and exit
--fig_length matplotlib figure length (default: 6)
--fig_width matplotlib figure width (default: 6)
--style matplotlib figure style (default: seaborn)
--title matplotlib figure title (default: None)
--xlabel matplotlib figure xlabel
--xkey x-axis key in csv file (default: l)
--ykey y-axis key in csv file (default: r)
--smooth smooth radius of y axis (default: 1)
--ylabel matplotlib figure ylabel
--avg_group average the curves in the same group and plot the mean
--shaded_std shaded region corresponding to standard deviation of the group
--shaded_err shaded region corresponding to error in mean estimate of the group
--legend_outside place the legend outside of the figure
--time enable this will set x_key to t, and activate parameters about time
--time_unit parameters about time, x axis time unit (default: h)
--time_interval parameters about time, x axis time interval (default: 1)
--xformat x-axis format
--xlim x-axis limitation (default: None)
--log_dir log dir (default: ./logs/)
--filename csv filename
--show show figure
--save save figure
--dpi DPI figure dpi (default: 400)
finally, the learning curves looks like this:
Features
- custom logger, style, key, label, interval, and so on ...
- multi-experiment plotter
- x-axis formatter features
- x-axis formatter features
- compatible with OpenAI-baseline monitor data style
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rl_plotter-2.0.0.tar.gz
(6.9 kB
view hashes)
Built Distributions
rl_plotter-2.0.0-py3.7.egg
(30.7 kB
view hashes)
rl_plotter-2.0.0-py3-none-any.whl
(26.9 kB
view hashes)
Close
Hashes for rl_plotter-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fa1e1447620fd1c9a3a0faa57d3aab896d149ebe0b0345661a655bd9a4359b0 |
|
MD5 | f9a65c6fc88d9ab208ef58c27a7af0ef |
|
BLAKE2b-256 | 351794cb3e143cc40524f0f410a358e6e15bed962379b5f537b172e00b06d37a |