Skip to content

Instantly share code, notes, and snippets.

View mikami520's full-sized avatar
🎯
Focusing

Chris Xiao mikami520

🎯
Focusing
View GitHub Profile
@karpathy
karpathy / microgpt.py
Last active February 25, 2026 06:43
microgpt
"""
The most atomic way to train and run inference for 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
@karpathy
karpathy / stablediffusionwalk.py
Last active February 17, 2026 13:09
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@ih2502mk
ih2502mk / list.md
Last active February 23, 2026 19:07
Quantopian Lectures Saved
@karpathy
karpathy / min-char-rnn.py
Last active February 24, 2026 10:55
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)