Deep Reinforcement Learning in Unity by Abhilash Majumder

Deep Reinforcement Learning in Unity by Abhilash Majumder

Author:Abhilash Majumder
Language: eng
Format: epub
ISBN: 9781484265031
Publisher: Apress


Attach Behavior Parameters Script

Behavior Parameters : Now in this case, since we have to use external brain for training our agent in ML Agents, the first objective is to attach all the necessary components to the blue agent. For this the most important part is to associate a brain for the agent, and in this case we will attach the “BehaviorParameters” script to the blue agent. Now as we have mentioned, this controls all the vector observations, stacked vectors, the action space, inference device, and child sensors. For our case, we will keep most of the details with the default values except the space size of the vector observation. This is because in our case, the agent can move along x and z axes. For each axis, the agent can move in the positive and negative direction—hence the possible space of observation is two along a single axis. For both x and z axes, the total vector observation space becomes 2*2, which is 4. We know internally there is a float array that is present in the vector observations section, numbered from 0 to 3.

Ray Perception Sensor Component 3D : We will attach this script, as it is associated with the Sensors module of the brain and is used for collecting observations in the scene. We will keep most of the default values as it is, such as angles, rays in each direction, ray length, and so forth, or we can change them accordingly. We have to define the detectable tags that the agent has to observe. In this case, the agent should only observe the target and the wall boundary of the platform; and those detectable tags are mentioned accordingly. Figure 4-17 shows this setup in Unity.

Figure 4-17RayPerceptionSensorComponent3D script attached to agent



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.