强化学习绘图机(RL)

rl-plotter的Python项目详细描述


rl绘图仪

PyPIGitHubGitHub last commit

这是一个简单的工具,可以很容易地绘制强化学习(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)

最后,学习曲线如下所示:

##特点 -[x]自定义记录器、样式、键、标签、间隔等。。。 -[x]多实验绘图仪 -[x]x轴格式化程序功能 -[x]兼容[OpenAI基线](https://github.com/openai/baselines)监视数据样式 -[x]特定实验对应颜色

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java TestNG跨浏览器测试在启动第一个浏览器后失败   java如何根据本地存储数据设置默认下拉值和选择   数组Java程序以打印字符串中只有一次可用的字符   java A4j:commndButton和A4j:commandLink未显示在输出中   javajavax。servlet。Apache Karaf 2.3.0中的http包   如果对象是可序列化/可打包的,则java是可序列化/可打包的数组   如果实现了自动关闭,java Helper将调用close()?   java不能转换为org。springframework。奥姆。冬眠4。LocalSessionFactoryBean   java Eclipse不会启动JVM不兼容   java Hibernate关系错误   java我应该设置“从池中获取连接”的超时吗?   java Spring引导连接到docker服务mongodb   java NullPointerException从何而来?   java JSP使src url的结尾成为javascript变量   java spring父上下文和子上下文之间有什么区别?