强化学习绘图机(RL)
rl-plotter的Python项目详细描述
rl绘图仪
这是一个简单的工具,可以很容易地绘制强化学习(RL)的学习曲线。在
安装
来自PIP
pip install rl_plotter
来源
^{pr2}$示例
首先,在代码中添加我们的记录器(与OpenAI-baseline兼容)
或者直接使用OpenAI-baseline工作台。监视器(推荐):
frombaselinesimportbenchenv=bench.Monitor(env,log_dir)
培训结束后或在培训代理时,您可以用以下方式绘制学习曲线:
rl_plotter --save --show
一般用法:
rl_plotter --save --show --avg_group --shaded_std
或者
rl_plotter --save --show --avg_group --shaded_std --shaded_err
如需帮助,请使用:
rl_plotter --help
你可以找到参数来定制曲线的样式。在
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: 10)
--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: ./)
--filename csv filename
--show show figure
--save save figure
--dpi figure dpi (default: 400)
最后,学习曲线如下所示:
- 项目
标签: