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)

Basic Terrarium – Plants and Herbivores

The bulk of our work in setting up our terrarium is going to be building the plants, agents that eat plants (herbivores), and agents that eat agents that eat plants (carnivores). We will start with our most basic form of terrarium inhabitant, the plant. Terrarium plants are not unlike their natural cousins; they continually increase in energy by just existing. When they reach a certain size, they also begin discharging seeds that produce more plants and so on. Open up Unity and follow along to create our first Terrarium inhabitant, the plant:

  1. Open the Terrarium scene where we last left it and from the menu select GameObject | Create Empty. Rename the new object Plant.
  2. Drag the Plant object onto the Environment -> Plane to attach it as a child. Make sure to reset the Transform Position to (0,0,0).
  3. Open the Assets/Free Low Poly...