Dự án handwired biến mã JavaScript thông thường thành mạng Nơ-ron
Handwired converts regular JavaScript into a fully differentiable neural‑net using matrix‑multiplication, enabling GPU‑level speed and novel training tricks.
2 phút đọc
Mục lục
is an open‑source library that converts ordinary code into a fully differentiable representation. It was created by Cheng Lou and is hosted on GitHub, gathering 1 828 stars. The tool rewrites if‑else, loops and stateful logic into and operations that can run on the or . Because the transformation keeps the program exact and requires no training, developers can explore analysis of classic JS algorithms. The project is noteworthy for bridging traditional code with modern tooling.
Chi tiết
Traditional frameworks expect models to be defined as that are trained from scratch, leaving ordinary code outside their scope. addresses this gap by taking a program built from if‑else statements, loops and mutable state, and translating it into a sequence of matrix multiplications followed by activations over values. This translation preserves the exact semantics of the original code while making the whole program differentiable.
The conversion works by expressing each as basic arithmetic, then aggregating all additions and ReLUs into a single large matrix multiplication. The resulting computation can be executed directly in or dispatched to for hardware acceleration. Since only two primitives—matmul and —are used, the whole program remains fully differentiable and can benefit from existing optimizations such as , and .
unlocks several unconventional use‑cases. Users can “” the manually written weights and train them, experiment with attaching a program to a for training, or obtain ‑level for code that was originally , as demonstrated by a JSON‑search demo that processes 100 k documents in milliseconds. The repository, written in , has attracted 1 828 stars on GitHub, indicating strong community interest in this novel approach.
Điểm nổi bật
- Unfreeze the generated weights and train them
- Attach a program to a for training
- Achieve ‑level for traditional (e.g., JSON search demo)
Vì sao đáng chú ý
Developers can analyze and optimize existing algorithms with tools without rewriting them as neural networks. The ability to run the transformed code on brings massive speedups to workloads that were previously limited to the engine. Moreover, the exact, training‑free conversion opens experimental research avenues such as that combine logic with learned components.
Thông tin nhanh
- Kho mã: chenglou/handwired
- Số sao: 1.828 · Fork: 151
- Ngôn ngữ: · Giấy phép:
Nguồn: GitHub
Tin do AI tóm tắt từ nguồn công khai (RSS, GitHub); bấm link nguồn để đọc bài gốc.
Bài này thế nào?
Bài viết có hữu ích với bạn?
Đánh giá giúp mình biết nên viết thêm về chủ đề nào.
