Learn Unity ML-Agents:Fundamentals of Unity Machine Learning
上QQ阅读APP看书,第一时间看更新

ML-Agents

For the rest of this book, we will be using the ML-Agents platform with Unity to build ML models that we can learn to play and simulate in various environments. Before we do that, though, we need to pull down the ML-Agents package from GitHub using git. Jump on your computer and open up a command prompt or shell window and follow along:

If you have never used git before, make sure to install it from  https://git-scm.com/. You will need to install git before continuing with the following exercises and thus the rest of this book.
  1. Navigate to your work or root folder (on Windows, we will assume that this is C:\):
      cd/
  1. Execute the following command:
      mkdir ML-Agents
  1. This will create the folder ML-Agents. Now, execute the following:
      cd ML-Agents
git clone https://github.com/Unity-Technologies/ml-agents.git
  1. This uses git to pull down the required files for ML-Agents into a new folder called ml-agents. git will show the files as they are getting pulled into the folder. You can verify that the files have been pulled down successfully by changing to the new folder and executing:
      cd ml-agents
dir
  1. Right now, we are doing this to make sure that there are any files here. We will get to the specifics later.

Good—that should have been fairly painless. If you had issues pulling the code down, you can always visit the ML-Agents page on GitHub at https://github.com/Unity-Technologies/ml-agents and manually pull the code down. Of course, we will be using more of git to manage and pull files, so you should resolve any problems you may have encountered.

If you are not familiar with GitHub and git, then you really should be. git completely dominates source control across all areas of software development now and is widely used, even at Microsoft, who abandoned their own source control for it. Do yourself a favor, even if you develop your code just for yourself: use source control.

Now that we have ML-Agents installed, we will take a look at one of Unity's sample projects that ships with a toolkit in the next section.