Loading WASM module...
Width: Height: Wall Density: Learning Rate: Max Steps: Generate & Optimize
This demo uses gradient descent to solve a discrete maze.
Try playing with the hyperparameters to see how they affect the optimization process!
No neural network involved: logits are directly optimized, from a random initialization, for each maze.
This runs entirely on your local device, thanks to candle and Rust's support for WebAssembly. You can disconnect from the Internet after loading this demo and you will still be able to use it!
Appearances can be deceiving: On harder and larger grids, you might find that much time is spent being "stuck", with a dramatic phase transition. Beware! And perhaps try increasing the step count.
Additional Details
This demo solves maze navigation by relaxing the discrete problem into a stochastic formulation that happens to be end-to-end differentiable.
Since every operation is differentiable, we use backpropagation with standard automatic differentiation (i.e. candle's autograd, which runs client-side) to directly optimize action logits, without relying on e.g. the REINFORCE algorithm, Q learning, Monte-Carlo rollouts, or any sort of neural network.
... continue reading