/micrograd-js

Karpathy's micrograd in JS + Property Type tests

Primary LanguageJavaScriptMIT LicenseMIT

Micrograd in JavaScript

This is reimplementing Andrej Karpathy's micrograd in JavaScript. I'm sure its been done elsewhere, but I like the idea of implementing it.

Implementing it myself from scratch was the most important

— Andrej Karpathy talking to Andrew Ng (2018) [1]

Install

npm install
npm test

Look at the engine.test.js. I've added property-based testing to show the power of including property-based testing with AI tools.

Since that we have the tests, we can abuse these to bring about a more Scheme like code base. An experiment with Gemini pro as the architect and Gemini flash as the coder locally in Aider.

Its mostly generated by AI, except for (the WIP) engine-experiment.js which is me following along with his video.