我需要一种以图形形式表示字典(或NumPy 2D数组)的方法,可能如下图所示
我的字典现在看起来像这样
Q: {(0,'U'): -0.1, (0,'R'): -0.254, (0,'D'): -0.9, (0,'L'): -0.23, ...}
其中U,R,D,L对应于方向,上,下,右&;左
对于其他上下文,我希望可视化SARSA学习方法的Q表。我在Jupyter笔记本上运行这个。 我正在运行SARSA,总共有10万集;希望每10公里一集都能看到Q表
我想matplotlib也许能做到这一点?但我对这种特殊的表现形式不太熟悉
如果有人知道更好的方法来表示Q表(相对于这种特殊的图形格式),我愿意接受建议。如果使用2D数组更好,我还可以将Q表表示为2D numpy数组而不是字典
提前感谢您的回复
我真的不知道Q表是什么,但我确实花了很多时间来想象不同的东西
根据我对你的问题的理解,你需要10个表,我在下面的代码中将它们排列成2行5列的格子。也就是说,我希望这段代码可以扩展到您需要的任何数量
我已经创建了一个字典,其中列出了我认为Q表中可能存在的代表性值?希望我的假设足够接近,您可以使用下面的代码将问题推过终点线
相关问题 更多 >
编程相关推荐