All workNeural networks · JavaScript

Self-Driving Car

A car that teaches itself to drive, with the neural network rendered live next to it so you can watch it decide.

Network schematic

Overview

Context

A self-directed project implementing a neural network from scratch in JavaScript, without a machine-learning library.

The problem

What it needed to solve

A neural network on paper is a matrix of weights. It stays abstract until you can see an input change and watch the output move.

A driving simulation with the network drawn beside it — sensor rays feed the input layer, and the active connections light up as the car steers.

Contribution

My role in the work

  • Implemented the network — layers, weights, and forward pass — directly in JavaScript.
  • Built the sensor model that turns raycast distances into network inputs.
  • Rendered the network alongside the simulation so its state is visible while it runs.

Decisions

Key decisions

  • Wrote the network by hand instead of importing a library, because the goal was understanding rather than accuracy.
  • Made the network visible on screen — debugging by observation is faster than reading weight dumps.
  • Kept the simulation interactive so behavior could be tested against changed conditions immediately.

Implementation

How it was built

  • Canvas-based driving simulation with raycast sensors.
  • A from-scratch feedforward network with live visualization of its weights and activations.

Outcome

What exists today

A working simulation, and a genuine understanding of what the math is doing — which was the point.

Continue exploring

View all selected work