Non-Euclidean Geometry Learning Path
A Rustlings-style interactive exercise system covering 63 exercises across 6 phases — from Euclidean review through hyperbolic geometry, Lie groups, Riemannian geometry, information geometry, and modern ML applications.
// DESCRIPTION
Project Overview / 项目概述
Non-Euclidean Geometry Learning Path is a Rustlings-style interactive exercise system that guides learners from classical Euclidean geometry all the way through hyperbolic geometry, Lie groups, Riemannian geometry, information geometry, and their modern machine learning applications. The curriculum spans 63 numbered exercises across 6 progressive phases, with a dedicated runner CLI providing list, run, watch, and hint commands — making advanced differential geometry accessible through hands-on coding.
非欧几何学习路径 是一个类 Rustlings 的交互式练习系统,引导学习者 从经典欧几里得几何出发,历经双曲几何、李群、黎曼几何、信息几何,直至其现代机器学习应用。 课程跨越 6 个渐进阶段、63 个编号练习,配有专用的 runner CLI,提供 list、run、watch 和 hint 命令, 通过动手编程让高级微分几何变得触手可及。
Situation & Motivation / 背景与动机
Modern machine learning increasingly operates on non-Euclidean spaces: hyperbolic embeddings capture hierarchical structure better than Euclidean vectors, SO(3) and SE(3) Lie groups are essential for robotics and SLAM, Riemannian optimisation generalises gradient descent to curved manifolds, and natural gradient methods (information geometry) are the theoretical foundation of many advanced optimisers. Yet non-Euclidean geometry is typically taught in pure-mathematics courses disconnected from ML practice. There was no single structured resource that connected the mathematical foundations directly to machine learning applications through interactive coding exercises.
现代机器学习越来越多地运作于非欧空间:双曲嵌入比欧几里得向量更好地捕捉层次结构, SO(3) 和 SE(3) 李群是机器人学和 SLAM 的基础,黎曼优化将梯度下降推广到弯曲流形, 自然梯度方法(信息几何)是许多高级优化器的理论基础。然而,非欧几何通常在纯数学课程中讲授, 与 ML 实践相脱节。目前还没有一个结构化资源通过交互式编程练习将数学基础与机器学习应用直接连接起来。
Task & Design Goals / 目标与设计
Design a six-phase progressive curriculum that starts from first principles and ends at cutting-edge ML applications, with each exercise requiring the learner to implement a specific mathematical concept in code. The system should support watch mode for iterative development, provide graded hints, and track progress in a JSON file. All exercises should run on standard scientific Python (NumPy, SciPy, geomstats, geoopt, torch-geometric).
设计一个六阶段渐进式课程,从基本原理出发,以前沿 ML 应用为终点,每道练习要求学习者 用代码实现特定的数学概念。系统应支持 Watch 模式以进行迭代开发,提供分级提示,并在 JSON 文件中追踪进度。 所有练习应能在标准科学 Python 环境(NumPy、SciPy、geomstats、geoopt、torch-geometric)上运行。
Action & Implementation / 实施细节
The curriculum is divided into six phases, each building directly on the previous:
- Phase 1 — Euclidean & Basic Geometry (Ex 00–04): Euclidean review, Gaussian curvature, Poincaré disk model, spherical geometry, projective geometry with homogeneous coordinates.
- Phase 2 — Hyperbolic Geometry (Ex 05–09): Poincaré half-plane, Lorentz model for neural network embeddings, inter-model transforms, hyperbolic distance computation (with batch gradients), and hyperbolic tree/hierarchy embedding.
- Phase 3 — Lie Groups & Rotations (Ex 10–14): SO(2) 2D rotations, SO(3) quaternions for 3D camera pose, SE(2) rigid body motion, SE(3) for SLAM and robotics, Lie algebra exponential/log maps.
- Phase 4 — Riemannian Geometry (Ex 15–19): Smooth manifolds and tangent spaces, Riemannian metric tensors, geodesics, parallel transport, Riemann and Ricci curvature tensors.
- Phase 5 — Information Geometry (Ex 20–24): Fisher information matrix, statistical manifolds, KL divergence geometry, natural gradient optimisation, probability simplices and exponential families.
- Phase 6 — ML Applications (Ex 25–63): Hyperbolic word embeddings (NLP), knowledge graph hierarchy embedding, camera pose estimation (CV), SLAM localisation, hyperbolic recommender systems, natural gradient policy optimisation (RL), multimodal cross-modal alignment, causal graph analysis, VAE on manifolds, contrastive learning geometry, Riemannian optimisation, and more.
The runner (runner.py) supports list, run XX,
watch, hint XX, and progress commands. Progress
is persisted in .progress.json. Each exercise is self-contained in
exercises/XX_topic/exercise.py with TODO markers.
Results & Impact / 成果与影响
The completed curriculum provides 63 progressive exercises covering six phases of non-Euclidean geometry from first principles to production ML applications. It is the only known interactive exercise system to connect Lie groups, Riemannian geometry, and information geometry directly to modern ML use-cases (knowledge graphs, SLAM, natural gradient RL, VAEs). The progression from Euclidean review to information geometry mirrors the mathematical maturity required for research-level ML, making it a unique self-study resource for practitioners who want rigorous geometric foundations.
完成的课程提供了 63 个渐进式练习,从基本原理出发,跨越六个非欧几何阶段,直至生产级 ML 应用。 这是目前已知的唯一一个将李群、黎曼几何和信息几何直接与现代 ML 应用(知识图谱、SLAM、 自然梯度 RL、VAE)连接起来的交互式练习系统。从欧几里得复习到信息几何的递进路径, 映射了研究级 ML 所需的数学成熟度,是希望打好严格几何基础的从业者的独特自学资源。