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

Building the contextual bandits

Now, with the updated logic for the Bandit and SimpleArm classes, we can continue by configuring our scene objects. Follow these steps to create the multiple bandits:

  1. From the menu, select GameObject -> Create Empty. Rename the new object Arms. We are going to make a container for all the bandit arms that the bandits will share. Sharing the arms will make setting up this task much simpler.
  2. Select the new Arms object in the Hierarchy window, and then from the menu select GameObject -> Create Empty. This should create a new child object of Arms. Rename the new child object GoldArm.
  3. Select GoldArm, and set its Material and rewardValue to one of your choosing.
  4. With GoldArm selected, press Ctrl + D(Command +

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