Watch a PPO2 agent play a car game in your browser!!!
A PPO model controls the car. It receives the game state as input (current lane, enemy lane, enemy y normalized) and decides which action to take (change lane left, change lane right, or go straight ahead) as output
The game uses ONNX Runtime Web JS to execute the pre-trained AI model in your browser ONNX (Open Neural Network Exchange) is a standard format that allows pytorch onnx models to be run on many different platforms (specifically js). This means the AI is executing 100% locally on your machine
The AI model was trained using a Reinforcement Learning algorithm specifically Proximal Policy Optimization. Learns by trial and error. It is rewarded for dodgin a car (15.0), alive per step (0.1), PENALTY_LANE_CHANGE (0.0), and penalized for crashing (-100)