Book Image

Learn Unity ML-Agents ??? Fundamentals of Unity Machine Learning

Book Image

Learn Unity ML-Agents ??? Fundamentals of Unity Machine Learning

Overview of this book

Unity Machine Learning agents allow researchers and developers to create games and simulations using the Unity Editor, which serves as an environment where intelligent agents can be trained with machine learning methods through a simple-to-use Python API. This book takes you from the basics of Reinforcement and Q Learning to building Deep Recurrent Q-Network agents that cooperate or compete in a multi-agent ecosystem. You will start with the basics of Reinforcement Learning and how to apply it to problems. Then you will learn how to build self-learning advanced neural networks with Python and Keras/TensorFlow. From there you move o n to more advanced training scenarios where you will learn further innovative ways to train your network with A3C, imitation, and curriculum learning models. By the end of the book, you will have learned how to build more complex environments by building a cooperative and competitive multi-agent ecosystem.
Table of Contents (8 chapters)

Partial observability, memory, and recurrent networks

One major difference between the Hallway and GridWorld examples is their perception of state, or observation. We already know that the GridWorld agent used visual observations, but we never really got into what state input the Hallway agent used. As it turns out, the Hallway agent collects observations of state in a different manner. It is important for us to understand the difference, so open up Unity and go through the following exercise:

  1. Make sure the Hallway example scene is loaded. Check back to the previous exercise if you need help.
  2. Locate the Agent object in the Hierarchy window. You can use the search bar at the top of the window to find it quicker.
  3. Find the Hallway Agent component/script in the Inspector window.
  4. Click the target icon beside the component and select Edit Script.... This will open your previously set...