Skip to content

Instantly share code, notes, and snippets.

View mikami520's full-sized avatar
🎯
Focusing

Chris Xiao mikami520

🎯
Focusing
View GitHub Profile
@mikami520
mikami520 / min-char-rnn.py
Created February 13, 2026 18:50 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@mikami520
mikami520 / microgpt.py
Created February 13, 2026 18:47 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp