Unity Ml-Agent 完成你的第一个强化学习项目

参考内容

CodeMonkey - How to use Machine Learning AI in Unity! (ML-Agents)

Making a New Learning Environment

Unity官方Github地址和文档内容
Unity ML-Agents Toolkit Documentation

CodeMonkey 更多的关于UnityML的系列内容
Machine Learning AI in Unity (ML-Agents)

常见问题

安装python https://www.python.org/downloads/windows/

如果你的命令行输入不起作用?windows下命令行模式中cd命令无效的原因

关于pytorch是什么?

pytorch与tensorflow https://zhuanlan.zhihu.com/p/104842311
适合PyTorch小白的官网教程 https://zhuanlan.zhihu.com/p/271659551
An open source machine learning framework that accelerates the path from research prototyping to production deployment. https://pytorch.org/
如何最简单、通俗地理解Pytorch? https://www.zhihu.com/question/439496333/answer/1715174511
你可以把 pytorch 理解为一个支持 gpu 的,可以进行求导的计算器。新添的这两个功能现在主要是给神经网络用的,所以 pytorch 里面也加了很多神经网络用的辅助工具

为什么需要安装Python虚拟机?

py的虚拟环境 A Virtual Environment is a self contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages.
A Virtual Environment keeps all dependencies for the Python project separate from dependencies of other projects. This has a few advantages:
It makes dependency management for the project easy.
It enables using and testing of different library versions by quickly spinning up a new environment and verifying the compatibility of the code with the different version.

调整超参数

在assets下面创建config的内容并且创建yaml文件
配置文件以及HyperParameter-Training Configuration File

mlagents-learn config/moveToGoal.yaml --run-id=TestParameter

基于模型的再训练

mlagents-learn config/moveToGoal.yaml --initialize-from=MoveToGoal --run-id=MoveToGoal2

可视化训练成果

在训练的同时打开另一个cmd
进入同一个虚拟机后输入

tensorboard --logdir results

然后在浏览器中输入

http://localhost:6006/

就可以查看实时的训练结果和目前的效果

后续其他的内容有待补充

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 今天感恩节哎,感谢一直在我身边的亲朋好友。感恩相遇!感恩不离不弃。 中午开了第一次的党会,身份的转变要...
    迷月闪星情阅读 10,620评论 0 11
  • 彩排完,天已黑
    刘凯书法阅读 4,336评论 1 3
  • 没事就多看看书,因为腹有诗书气自华,读书万卷始通神。没事就多出去旅游,别因为没钱而找借口,因为只要你省吃俭用,来...
    向阳之心阅读 4,834评论 3 11
  • 表情是什么,我认为表情就是表现出来的情绪。表情可以传达很多信息。高兴了当然就笑了,难过就哭了。两者是相互影响密不可...
    Persistenc_6aea阅读 126,257评论 2 7