O'Reilly logo

Learn Unity ML-Agents - Fundamentals of Unity Machine Learning by Micheal Lanham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fixing sparse rewards

Reward issues can happen when you attempt to set the rewards too high or low, or when the opportunity for a reward is rare or sparse. In our last example, when we expanded the grid to an area of 20 x 20 from an area of 5 x 5, we also made our reward very sparse or rare. That means that an agent needs to be especially lucky in order to stumble upon a reward. We can improve this by increasing the number of goals available. Go through the following steps to correct the problem of sparse rewards:

  1. Open up the Unity editor and locate the Grid Academy object and component in the Inspector window.
  2. Set the numGoals property to 10. Increasing the number of goals should allow the agent to more easily stumble upon a positive reward. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required