Embedding the model
In the last section, the neural network controlling the monster evolved to get better at navigating the environment and eating food. When we stopped the training, a .nn
file was created. This file represents the trained neural network for the monster. We do not need to re-train the Agent; we can instead use this model to achieve the behavior we expect. We could even provide this model to any number of Agents (as long as they have the same configuration as our monster), and these new Agents would happily move around the environment, avoiding walls and rocks while chasing chicks. But that's getting ahead of ourselves. Let's first use the model with the original monster:
Locate the Monster.nn
model exported in the previous section. As you can see from Figure 10.26, the path to my model is located in the <project root>/models/Monster
folder.
- Drag this file into the Project panel in Unity to the
Assets/Models
folder (create the folder if...