Visual & Interactive Algorithm Learning Platform

AlgoLab

算法可视化与交互学习平台。每个算法页面都是一篇可执行教程,组合说明、公式、代码、分步执行、图表、参数交互和 LLM 解释。

Design Principles
No. 1Optimization
FreeBeginner

线性模型中的梯度下降

Gradient Descent for a Linear Model

用最小线性回归例子理解 loss、gradient、参数更新,并通过实时调参观察训练曲线与拟合效果。

No. 2Classification
FreeBeginner

用 MLP 拟合非线性关系

MLP: Fitting Nonlinear Functions

从最小两层感知机出发,理解隐藏层、ReLU、反向传播和 autograd,并通过交互实验观察 MLP 如何拟合非线性关系。

No. 3Deep Learning
FreeIntermediate

系统理解 Transformer:Self-Attention 如何让词彼此看见

Transformer: Understanding Self-Attention

从最小词序列任务出发,系统拆解 Q/K/V、scaled dot-product attention、softmax、信息融合、多头注意力和 Tiny Transformer 训练过程。

No. 4Deep Learning
FreeIntermediate

VAE:从 latent space 到概率生成

VAE: From Latent Space to Probabilistic Generation

从最小二维 latent space 出发,理解 Encoder 如何输出 μ 和 σ、重参数化如何采样 z、Decoder 如何生成结果,以及 reconstruction loss 与 KL loss 如何共同塑造可生成的连续空间。

No. 5Deep Learning
FreeIntermediate

学习 Diffusion / DDPM:从加噪去噪到图像生成

Diffusion / DDPM: From Noising and Denoising to Image Generation

从 DDPM 的前向扩散公式出发,用最小二维数据和 16×16 几何图像理解 forward 加噪、高斯噪声张量 epsilon、噪声预测训练目标、reverse 去噪采样和 scheduler 直觉,并通过 Tiny DDPM 实验观察模型如何从雪花噪声中恢复图像结构。

No. 6LLM
FreeIntermediate

学习 GPT:从预测下一个 token 到 TinyGPT 与规模化范式

GPT: From Next-Token Prediction to TinyGPT and the Scaling Paradigm

用一个最小字符级 GPT 实验理解 decoder-only Transformer:文本如何变成 token 和 embedding,causal self-attention 如何禁止偷看未来,cross entropy loss 如何驱动模型学习下一个 token 的概率分布;再通过文本续写、一位数加法、涌现能力、参数压缩和世界模型视角,理解 GPT 如何从 TinyGPT 骨架走向大规模语言模型范式。

No. 7LLM
FreeIntermediate

TinyCodeGPT:从零训练一个本地任务代码生成模型

TinyCodeGPT: Train a Local Task-to-Code LLM from Scratch

把前面 GPT 的 next-token 原理推进到真实工程闭环:设计 Math、Python、NumPy、Pandas、Matplotlib、ML 六类 task→code 任务,利用大模型蒸馏生成训练数据,自动验证清洗样本,在本机用 PyTorch 训练 TinyCodeGPT,实时观察 loss、token 概率、checkpoint 和生成代码的运行结果,让初学者完整学会自己训练一个小型 LLM 任务模型。

No. 8LLM
FreeIntermediate

Tool-Calling TinyGPT:训练一个会调用工具的小模型

Tool-Calling TinyGPT: Train a Local Tiny Model That Emits Tool Calls

在 TinyCodeGPT 的本地训练闭环之上进入第二阶段:不再让小模型直接写完整代码,而是训练它把用户请求翻译成 CALL calculator / CALL plot / CALL search 三类结构化工具指令,并在本地执行、验证、评测工具选择准确率、JSON 合法率和执行通过率。

No. 9LLM
FreeAdvanced

LoRA 领域助手:微调一个本地 1.5B~3B 小模型

LoRA Domain Assistant: Fine-Tune a Local 1.5B-3B Model

第三阶段从 TinyGPT 走向真正可用的本地领域助手:选择用户本地已下载的 1.5B~3B instruct 模型,用 LoRA 或 QLoRA 只训练少量 adapter 参数,通过本地 HTTP runner 调用 GPU 优先训练、保存 checkpoint、加载当前 adapter 推理,并用领域问答评测从 loss 走向可用性。

No. 10Deep Learning
FreeIntermediate

学习 Latent Diffusion:在 latent space 中做 DDPM 图像生成

Latent Diffusion: DDPM Image Generation in Latent Space

把 No.4 的 VAE latent space 和 No.5 的 DDPM 加噪去噪接起来,理解 Latent Diffusion 如何先把图像压缩成 latent,再在 latent 空间中训练噪声预测模型,最后通过 Decoder 把去噪后的 latent 还原成图像。

No. 11Deep Learning
FreeIntermediate

学习 Cross Attention:Prompt 如何控制 Latent Diffusion

Cross Attention: How Prompts Guide Latent Diffusion

在 No.4 VAE、No.5 DDPM 和 No.10 Latent Diffusion 的基础上,理解 Cross Attention 如何把 prompt token 注入 denoising network,让 latent 空间中的每个位置在预测噪声时读取文字条件,从而控制图像生成方向。

No. 12Deep Learning
FreeIntermediate

学习 DiT:从 U-Net Denoiser 到 Diffusion Transformer

DiT: From U-Net Denoisers to Diffusion Transformers

在 No.3 Transformer、No.4 VAE、No.5 DDPM、No.10 Latent Diffusion 与 No.11 条件生成的基础上,理解 DiT 如何把 noisy latent 切成 patch tokens,通过 timestep/class embeddings 与 adaLN-Zero 调制 Transformer blocks,在不改变 DDPM 训练目标和采样规则的前提下,用 Transformer 替换 U-Net denoiser。

No. 13Deep Learning
FreeIntermediate

学习 Flow Matching:从 Diffusion 到 Rectified Flow

Flow Matching and Rectified Flow: From Diffusion to Straight ODE Paths

承接 No.4 VAE、No.5 DDPM、No.10 Latent Diffusion、No.11 条件生成与 No.12 DiT,把生成目标从预测噪声改写为学习连续速度场,理解 Flow Matching、Rectified Flow、Reflow 与 ODE 采样,并用 Tiny DiT 在 latent 中完成条件生成。