chenglou/handwired

★ 847⑂ 67

Turn your regular JavaScript code into a neural net.

About chenglou/handwired

chenglou/handwired is an open-source project on GitHub, mainly written in TypeScript. Turn your regular JavaScript code into a neural net. It currently holds 847 stars and 67 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board, currently at rank #91 with 0 new stars today.

GitHub Repository Details

Repository chenglou/handwired · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

Handwired

Turn your regular JavaScript code into a neural net; no training, exact, yet also fully differentiable!

How It Works

A program's made of if-else, loops, and state. Handwired transforms them into matrix multiplication + reglu over floats. For example:

const a = 5
const result = (a > 4) ? 10 : 12

The above can be expressed as basic arithmetic:

const a = 5
// Math.max(0, x) is ReLU. For an integer a, above4 is 1 if a > 4, and 0 otherwise
const above4 = Math.max(0, a - 4) - Math.max(0, a - 5)
// Both branches compute, and above4 picks one
const result = above4  10 + (1 - above4)  12

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:

Play With It

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)

HandwiredOS

GitHub Stars & Activity

847Stars
67Forks
0Open issues
TypeScriptLanguage

GitHub Popularity

GitHub stars847
Forks67
Open issues0
Primary languageTypeScript
License-
Stars gained today0
Created-
Last pushed-

Trending History

Daily boardrank #91 · ▲ 0 stars
Weekly boardrank #82 · ▲ 0 stars

Related AI Projects

1

morluto / rea

TypeScript★ 266,499⑂ 66,930▲ 32,282 stars
→
2

anomalyco / opencode

TypeScript★ 213,868⑂ 28,699▲ 375 stars
→
3

paperclipai / paperclip

TypeScript★ 102,635⑂ 17,188▲ 584 stars
→
4

stablyai / orca

TypeScript★ 93,310⑂ 5,948▲ 937 stars
→
5

ruvnet / ruflo

TypeScript★ 74,993⑂ 8,918▲ 224 stars
→
6

heygen-com / hyperframes

TypeScript★ 64,403⑂ 5,787▲ 879 stars
→
7

Crosstalk-Solutions / project-nomad

TypeScript★ 40,263⑂ 4,065▲ 180 stars
→
8

tashfeenahmed / freellmapi

TypeScript★ 35,694⑂ 4,827▲ 583 stars
→

More AI Rankings