找回密码
 立即注册
查看: 780|回复: 0

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

[复制链接]
发表于 2021-4-12 13:59 | 显示全部楼层 |阅读模式
参考内容


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/
就可以查看实时的训练结果和目前的效果

后续其他的内容有待补充
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-9-20 23:28 , Processed in 0.129720 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表