This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Copyright (c) 2026 Nenad Mićić <nenad@micic.be> https://be.linkedin.com/in/nenadmicic | |
| * SPDX-License-Identifier: Apache-2.0 | |
| * | |
| * microgpt.c — Minimal GPT training and inference in 655 lines of pure C. | |
| * Hand-written forward and backward pass, two-phase gradient accumulation. | |
| * Trains a 1-layer, 4-head, 4192-parameter character-level transformer. | |
| * | |
| * Inspired by Andrej Karpathy's microgpt.py (200 lines of Python): | |
| * https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95 | |
| * |