Skip to main content
Iheb Jdey
Back to Work

Reinforcement Learning · Unity

Machine Learning Agent Target Chase

Unity reinforcement-learning experiment covering environment design, ML-Agents training, TensorBoard monitoring and ONNX inference.

  • Unity
  • C#
  • Python
  • ML-Agents
  • PyTorch
  • TensorBoard
  • ONNX
View repository
Initial Unity target-chase environment with the learning agent, target and scene obstacles.
Initial 3D environment prepared for the target-chase experiment.

01

Experiment Context

The project applies observations, actions and reward signals to a target-seeking navigation task, with TensorBoard used to inspect training progression.

Environment
Unity 3D
Package
ML Agents 2.0.1
Demo
00:28

02

Learning Task

  1. 01Target-seeking agent behavior inside a Unity 3D environment
  2. 02Positive and negative reward signals for learning
  3. 03Named and resumed ML-Agents training runs
  4. 04TensorBoard monitoring and exported ONNX policy for Unity inference

03

Training Workflow

  1. 01Prepare Python 3.9.13 and create a virtual environment
  2. 02Update pip and install ML-Agents with PyTorch, Protocol Buffers and ONNX
  3. 03Start a named training run and resume from a previous result when needed
  4. 04Monitor cumulative reward and episode length in TensorBoard
  5. 05Install ML Agents 2.0.1 through Unity Package Manager and use the trained policy in Unity

04

TensorBoard Monitoring

The supplied dashboard records multiple named runs and exposes cumulative reward, reward distribution and episode-length metrics.

TensorBoard dashboard displaying cumulative reward, reward distribution and episode length for multiple ML-Agents runs.
TensorBoard monitoring across the Test1, Test2 and Test3 training runs.

05

Unity Integration

The Unity Package Manager evidence confirms the ML Agents package used to connect the trained behavior to the Unity project.

Unity Package Manager showing the ML Agents 2.0.1 package installed in the project.
ML Agents 2.0.1 integration through Unity Package Manager.

06

Project Demonstration

The short recording is included as optional runtime evidence after the faster screenshot and training overview.

Video summary: Supplied 28-second demonstration of the Unity ML-Agents project.

07

Technical Approach

  1. 01Python 3.9.13 virtual environment with an updated pip toolchain
  2. 02ML-Agents toolkit with PyTorch, Protocol Buffers and ONNX dependencies
  3. 03ML Agents 2.0.1 installed through Unity Package Manager
  4. 04C# environment and agent behavior with X/Z movement and obstacle collisions

08

Limitations

  1. 01The supplied TensorBoard evidence documents training activity but does not provide a controlled comparison between policies.
  2. 02The environment remains intentionally simple and does not document complex randomized scenarios.

09

Repository