gitmyhub

ml-agents

C# ★ 19k updated 3d ago

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.

An open-source toolkit that lets you use Unity game environments as training grounds for AI, teaching agents to make decisions through reinforcement learning without writing explicit rules.

C#UnityPythonPyTorchsetup: hardcomplexity 4/5

Unity ML-Agents is an open-source toolkit that lets you use Unity game environments — the same engine used to build video games — as training grounds for teaching AI to make decisions. The core idea is reinforcement learning: instead of programming explicit rules for how an agent (a character, robot, or object) should behave, you let the AI figure out the best actions by trying things out and receiving rewards for success. Unity's 3D, 2D, and VR/AR environments make rich and varied training scenarios easy to set up.

The toolkit has two main parts: a C# SDK that you integrate into your Unity scene to define what agents can observe and do, and a Python training library (built on PyTorch) that runs the learning algorithms outside the game. Game developers can use it to control NPCs (non-player characters) with learned behavior or to automatically test their game before release. Researchers can plug in their own algorithms via a Python API. Supported algorithms include PPO and SAC (popular deep reinforcement learning methods) and two imitation learning approaches that let agents learn by watching examples rather than trial and error. Multi-agent scenarios — cooperative teams or competitive opponents — are also supported.

You would use ML-Agents when you want to train intelligent behavior in a simulated environment, whether for a game, robotics research, or AI experimentation. The tech stack is Unity (C#) for environments and Python/PyTorch for training.

Where it fits