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

Creating the ContextualDecision script

We now need to upgrade the decision code from the multi-armed bandit problem to a contextual bandit problem. Go ahead and jump into the editor and follow these steps:

  1. Locate the SimpleDecision script in the Assets/Simple/Scripts folder. Select the script and type Ctrl + D (Command + D on macOS) to duplicate the script. This will duplicate the script and cause an error. Not to worry; the error is just a duplicate name that we will fix shortly.
  2. Rename the new script ContextualDecision, and then double-click on it to open it in your code editor.
  1. Rename the class to ContextualDecision as follows:
      public class ContextualDecision : MonoBehaviour, Decision
  1. Add or modify the variable declarations at the ...

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