chenglou/handwired: Turn your regular JavaScript code into a neural net. ·
Turn your regular JavaScript code into a neural net; no training, exact, yet also fully differentiable! A program's made of if-else, loops, and state. Handwired transforms them into matrix multiplication + reglu over floats. For example: The above can be expressed as basic arithmetic: You can calculate that by hand and see that both arrive at the same result. We then collect the + and * and relu into a giant matmul, and either run it on JS or WebGPU, for fun. Because we basically only use these 2 primitives: This unlocks lots of funny use-cases, like: Try the demos live: https://chenglou.me/handwired/ git clone && bun install, then bun start to run them locally. Check docs/, src/ and template/ to get started! (lab/ is a bunch of old experiments you can check or ignore) Turn your regular JavaScript code into a neural net.