math-skill 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +50 -30
- package/README.md +26 -6
- package/agents/math-critic.en.md +30 -28
- package/agents/math-critic.md +30 -30
- package/commands/ask.en.md +15 -0
- package/commands/ask.md +6 -1
- package/design-patterns/attention/equivariant-attention.en.md +17 -11
- package/design-patterns/attention/equivariant-attention.md +16 -10
- package/design-patterns/attention/geometry-aware-attention.en.md +11 -11
- package/design-patterns/attention/geometry-aware-attention.md +10 -10
- package/design-patterns/attention/information-bottleneck-attention.en.md +40 -20
- package/design-patterns/attention/information-bottleneck-attention.md +40 -20
- package/design-patterns/attention/projection-attention.en.md +12 -12
- package/design-patterns/attention/projection-attention.md +11 -11
- package/design-patterns/attention/spectral-attention.en.md +27 -13
- package/design-patterns/attention/spectral-attention.md +26 -12
- package/design-patterns/compression/leverage-score-selection.en.md +14 -14
- package/design-patterns/compression/leverage-score-selection.md +14 -14
- package/design-patterns/compression/low-rank-kv-cache.en.md +40 -13
- package/design-patterns/compression/low-rank-kv-cache.md +39 -13
- package/design-patterns/compression/spectral-token-pruning.en.md +17 -15
- package/design-patterns/compression/spectral-token-pruning.md +17 -15
- package/design-patterns/compression/topology-preserving-compression.en.md +11 -11
- package/design-patterns/compression/topology-preserving-compression.md +11 -11
- package/design-patterns/loss/constraint-penalty.en.md +9 -5
- package/design-patterns/loss/constraint-penalty.md +10 -7
- package/design-patterns/loss/contrastive-loss.en.md +38 -12
- package/design-patterns/loss/contrastive-loss.md +39 -13
- package/design-patterns/loss/information-bottleneck-loss.en.md +6 -6
- package/design-patterns/loss/information-bottleneck-loss.md +7 -7
- package/design-patterns/loss/orthogonality-loss.en.md +25 -18
- package/design-patterns/loss/orthogonality-loss.md +25 -19
- package/design-patterns/loss/variational-loss.en.md +5 -5
- package/design-patterns/loss/variational-loss.md +6 -6
- package/design-patterns/overview.en.md +36 -0
- package/design-patterns/overview.md +36 -0
- package/design-patterns/representation/equivariant-split.en.md +5 -5
- package/design-patterns/representation/equivariant-split.md +5 -6
- package/design-patterns/representation/manifold-representation.en.md +13 -13
- package/design-patterns/representation/manifold-representation.md +14 -15
- package/design-patterns/representation/shared-private-decomposition.en.md +13 -8
- package/design-patterns/representation/shared-private-decomposition.md +13 -10
- package/design-patterns/representation/subspace-alignment.en.md +13 -13
- package/design-patterns/representation/subspace-alignment.md +13 -13
- package/design-patterns/routing/graph-routing.en.md +12 -12
- package/design-patterns/routing/graph-routing.md +12 -12
- package/design-patterns/routing/moe-routing.en.md +13 -13
- package/design-patterns/routing/moe-routing.md +13 -15
- package/design-patterns/routing/optimal-transport-routing.en.md +6 -6
- package/design-patterns/routing/optimal-transport-routing.md +7 -7
- package/design-patterns/routing/spectral-clustering-routing.en.md +27 -16
- package/design-patterns/routing/spectral-clustering-routing.md +27 -18
- package/knowledge-base/differential-geometry/connection.en.md +17 -2
- package/knowledge-base/differential-geometry/connection.md +17 -2
- package/knowledge-base/differential-geometry/curvature.en.md +14 -1
- package/knowledge-base/differential-geometry/curvature.md +14 -1
- package/knowledge-base/differential-geometry/geodesic.en.md +16 -2
- package/knowledge-base/differential-geometry/geodesic.md +16 -2
- package/knowledge-base/differential-geometry/index.en.md +52 -0
- package/knowledge-base/differential-geometry/index.md +52 -0
- package/knowledge-base/differential-geometry/manifold.en.md +15 -2
- package/knowledge-base/differential-geometry/manifold.md +15 -2
- package/knowledge-base/differential-geometry/metric-tensor.en.md +16 -2
- package/knowledge-base/differential-geometry/metric-tensor.md +17 -3
- package/knowledge-base/differential-geometry/tangent-space.en.md +17 -3
- package/knowledge-base/differential-geometry/tangent-space.md +17 -3
- package/knowledge-base/information-geometry/fisher-metric.en.md +32 -13
- package/knowledge-base/information-geometry/fisher-metric.md +32 -13
- package/knowledge-base/information-geometry/index.en.md +45 -0
- package/knowledge-base/information-geometry/index.md +45 -0
- package/knowledge-base/information-geometry/natural-gradient.en.md +24 -10
- package/knowledge-base/information-geometry/natural-gradient.md +24 -10
- package/knowledge-base/lie-theory/equivariance.en.md +18 -3
- package/knowledge-base/lie-theory/equivariance.md +18 -3
- package/knowledge-base/lie-theory/group-action.en.md +16 -2
- package/knowledge-base/lie-theory/group-action.md +16 -2
- package/knowledge-base/lie-theory/index.en.md +52 -0
- package/knowledge-base/lie-theory/index.md +52 -0
- package/knowledge-base/lie-theory/lie-algebra.en.md +17 -2
- package/knowledge-base/lie-theory/lie-algebra.md +17 -2
- package/knowledge-base/lie-theory/lie-group.en.md +17 -3
- package/knowledge-base/lie-theory/lie-group.md +17 -3
- package/knowledge-base/lie-theory/representation.en.md +17 -2
- package/knowledge-base/lie-theory/representation.md +17 -2
- package/knowledge-base/matrix-analysis/index.en.md +49 -0
- package/knowledge-base/matrix-analysis/index.md +49 -0
- package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +20 -7
- package/knowledge-base/matrix-analysis/low-rank-approximation.md +20 -7
- package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +13 -1
- package/knowledge-base/matrix-analysis/matrix-perturbation.md +13 -1
- package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +20 -6
- package/knowledge-base/matrix-analysis/positive-semidefinite.md +20 -6
- package/knowledge-base/matrix-analysis/projection.en.md +14 -1
- package/knowledge-base/matrix-analysis/projection.md +14 -1
- package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +14 -1
- package/knowledge-base/matrix-analysis/spectral-decomposition.md +14 -1
- package/knowledge-base/optimization/constrained-optimization.en.md +17 -3
- package/knowledge-base/optimization/constrained-optimization.md +17 -3
- package/knowledge-base/optimization/convex-optimization.en.md +15 -2
- package/knowledge-base/optimization/convex-optimization.md +15 -2
- package/knowledge-base/optimization/index.en.md +50 -0
- package/knowledge-base/optimization/index.md +50 -0
- package/knowledge-base/optimization/lagrangian-duality.en.md +18 -4
- package/knowledge-base/optimization/lagrangian-duality.md +18 -4
- package/knowledge-base/optimization/proximal-method.en.md +15 -1
- package/knowledge-base/optimization/proximal-method.md +15 -1
- package/knowledge-base/optimization/riemannian-optimization.en.md +18 -4
- package/knowledge-base/optimization/riemannian-optimization.md +18 -4
- package/knowledge-base/overview.en.md +20 -8
- package/knowledge-base/overview.md +20 -8
- package/knowledge-base/probability/concentration-inequality.en.md +21 -7
- package/knowledge-base/probability/concentration-inequality.md +21 -7
- package/knowledge-base/probability/entropy.en.md +24 -8
- package/knowledge-base/probability/entropy.md +23 -7
- package/knowledge-base/probability/fisher-information.en.md +24 -10
- package/knowledge-base/probability/fisher-information.md +24 -10
- package/knowledge-base/probability/index.en.md +51 -0
- package/knowledge-base/probability/index.md +51 -0
- package/knowledge-base/probability/information-bottleneck.en.md +24 -8
- package/knowledge-base/probability/information-bottleneck.md +24 -8
- package/knowledge-base/probability/kl-divergence.en.md +21 -8
- package/knowledge-base/probability/kl-divergence.md +21 -8
- package/knowledge-base/topology/euler-characteristic.en.md +15 -2
- package/knowledge-base/topology/euler-characteristic.md +15 -2
- package/knowledge-base/topology/fundamental-group.en.md +16 -2
- package/knowledge-base/topology/fundamental-group.md +16 -2
- package/knowledge-base/topology/index.en.md +48 -0
- package/knowledge-base/topology/index.md +48 -0
- package/knowledge-base/topology/persistent-homology.en.md +17 -2
- package/knowledge-base/topology/persistent-homology.md +17 -2
- package/lenses/algorithmic.en.md +1 -1
- package/lenses/algorithmic.md +1 -1
- package/lenses/axiomatization.en.md +1 -1
- package/lenses/axiomatization.md +1 -1
- package/lenses/categorical.en.md +1 -1
- package/lenses/categorical.md +1 -1
- package/lenses/causal.en.md +1 -1
- package/lenses/causal.md +1 -1
- package/lenses/duality.en.md +1 -1
- package/lenses/duality.md +1 -1
- package/lenses/game.en.md +2 -2
- package/lenses/game.md +2 -2
- package/lenses/geometric.en.md +1 -1
- package/lenses/geometric.md +1 -1
- package/lenses/local-to-global.en.md +1 -1
- package/lenses/local-to-global.md +1 -1
- package/lenses/perturbation.en.md +1 -1
- package/lenses/perturbation.md +1 -1
- package/lenses/probabilistic.en.md +1 -1
- package/lenses/probabilistic.md +1 -1
- package/lenses/projection.en.md +1 -1
- package/lenses/projection.md +1 -1
- package/lenses/spectral.en.md +2 -2
- package/lenses/spectral.md +2 -2
- package/lenses/symmetry.en.md +1 -1
- package/lenses/symmetry.md +1 -1
- package/lenses/topological.en.md +2 -2
- package/lenses/topological.md +2 -2
- package/lenses/variational.en.md +1 -1
- package/lenses/variational.md +1 -1
- package/package.json +5 -5
- package/references/agentic-workflow.en.md +3 -3
- package/references/agentic-workflow.md +1 -1
- package/references/books/abstract-algebra.en.md +124 -0
- package/references/books/abstract-algebra.md +17 -17
- package/references/books/algebraic-geometry-rising-sea.en.md +171 -0
- package/references/books/algebraic-geometry-rising-sea.md +7 -7
- package/references/books/differential-geometry.en.md +140 -0
- package/references/books/differential-geometry.md +23 -23
- package/references/books/matrix-analysis.en.md +146 -0
- package/references/books/matrix-analysis.md +32 -32
- package/references/books/micro-lie-theory.en.md +116 -0
- package/references/books/micro-lie-theory.md +16 -16
- package/references/books/optimization-ml.en.md +163 -0
- package/references/books/optimization-ml.md +20 -21
- package/references/books/smooth-manifolds.en.md +105 -0
- package/references/books/smooth-manifolds.md +15 -15
- package/references/gpu-friendly-math.en.md +35 -9
- package/references/gpu-friendly-math.md +33 -5
- package/references/skill-index.en.md +105 -0
- package/references/skill-index.md +105 -0
- package/skills/math-research-activator/SKILL.en.md +72 -88
- package/skills/math-research-activator/SKILL.md +61 -78
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# A Micro Lie Theory
|
|
2
|
+
|
|
3
|
+
> **A micro Lie theory for state estimation in robotics** -- Joan Solà, Jeremie Deray, Dinesh Atchuthan.
|
|
4
|
+
> arXiv:1812.01537v9 [cs.RO], 2021-12-08, main text approx. 17 pages + appendix formula handbook. Companion open-source C++ header library **manif** (<https://github.com/artivis/manif>, implementing SO(2)/SO(3)/SE(2)/SE(3) with analytic Jacobians).
|
|
5
|
+
> This file is an "activation" distillation, **not a restatement of the original**; for full fidelity, consult the local PDF (see (Deep Dive Entry)).
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This paper **deliberately "amputates"** the vast edifice of Lie theory down to the minimal subset needed for robotic state estimation: it does not even introduce the Lie bracket, instead reducing the Lie algebra directly to the isomorphic vector space R^n, so that the "curved, nonlinear" Lie group becomes "flat, linear" vector algebra in the tangent space. The one-sentence thesis: **virtually every operation on the group (curved) has an exact counterpart in the Lie algebra (flat)** (Fig. 1) -- this is the modern use of Sophus Lie's "dragon-slaying sword" from inspiration.md: the dragon (solving differential equations) was never slain, yet the sword became a supreme tool for chopping vegetables (linearizing nonlinearities), carving (describing symmetries), and building houses (robotic state estimation).
|
|
10
|
+
|
|
11
|
+
Actual structure map:
|
|
12
|
+
- **II. A micro Lie theory (core)**: A Lie groups (group axioms + manifold) -> B group actions -> C tangent space and Lie algebra (hat `^wedge` / vee `^vee` operators) -> D **exponential map** exp/log and capital Exp/Log (Eq. 23-24) -> E **addition/subtraction operators** oplus/ominus (Eq. 25-28, left and right versions) -> F **adjoint** Ad_X and adjoint matrix (Eq. 30-35) -> G **derivatives on Lie groups**: right Jacobian (Eq. 41a-c) / left Jacobian (Eq. 44) -> H **uncertainty on manifolds and covariance propagation** (Eq. 52) -> I discrete integration on manifolds.
|
|
13
|
+
- **III. Manifold differentiation rules**: A chain rule, B elementary Jacobian blocks, C derived Jacobian blocks.
|
|
14
|
+
- **IV. Composite manifolds / bundles**: assembling heterogeneous large states into non-interacting manifold blocks, differentiating block by block (Eq. 84-90, Ex. 7 comparing SE(n) vs T(n)xSO(n) vs (R^n, SO(n))).
|
|
15
|
+
- **V. Applications**: landmark-based localization and mapping -- error-state Kalman filter on manifolds (Eq. 92-96), graph-optimization SLAM, sensor self-calibration.
|
|
16
|
+
- **VI. Conclusion + Appendix**: complete closed-form formulas for S^1/SO(2)/SE(2), S^3/SO(3), SE(3) (including right/left Jacobians, e.g. SO(3) Eq. 143-145).
|
|
17
|
+
|
|
18
|
+
## Core Structures Transferable to AI/Infra
|
|
19
|
+
|
|
20
|
+
The paper welds together the "curved nonlinear group" and the "flat linear vector space" using five tools, each of which can be directly ported into differentiable algorithms.
|
|
21
|
+
|
|
22
|
+
### 1. exp/log Maps -> Manifold Parameterization (Eq. 23-24, Fig. 1)
|
|
23
|
+
|
|
24
|
+
`Exp: R^n -> M`, `Log: M -> R^n` are the bijective bridges between the manifold and its tangent space (isomorphic to linear R^n). Transfer usage: **let the network freely predict in the unconstrained tangent space R^n, then map back to the valid manifold via Exp**. Rotations, poses, and unit quaternions thus naturally satisfy constraints (orthogonality, unit norm), eliminating the need for various ad-hoc post-hoc orthogonalization or normalization fixes on regressed matrices/quaternions.
|
|
25
|
+
|
|
26
|
+
### 2. oplus/ominus Addition/Subtraction Operators -> "Vector Algebra" on Manifolds (Eq. 25-28)
|
|
27
|
+
|
|
28
|
+
`oplus` (one Exp + one group composition) makes "adding an increment to a manifold state" look like ordinary vector addition; `ominus` computes the difference between two elements (geodesic residual). **Key pitfall**: because group composition is non-commutative, oplus/ominus come in **right versions** (increment in local frame / tangent at X) and **left versions** (increment in global frame / tangent at identity E); the paper defaults to the right version -- in engineering, one must stay consistent throughout; mixing conventions leads to errors.
|
|
29
|
+
|
|
30
|
+
### 3. Right/Left Jacobians -> Geometrically Correct Backpropagation (Eq. 41a-c, 44)
|
|
31
|
+
|
|
32
|
+
The linearization of a manifold function with respect to tangent-space perturbations is the Jacobian; the chain rule on manifolds takes the form `D(g o f)/DX = J_g . J_f` (Sec. III-A), isomorphic to the Euclidean chain rule, so it plugs directly into automatic differentiation. The **right Jacobian** (Eq. 41) and **left Jacobian** (Eq. 44) describe the same derivative in local vs. global tangent spaces, related to each other through the adjoint Ad.
|
|
33
|
+
|
|
34
|
+
### 4. Adjoint Matrix Ad_X -> Transporting Tangent Vectors Across Frames (Eq. 30-35)
|
|
35
|
+
|
|
36
|
+
`Ad_X` transports the same tangent vector between different points and left/right frames (Eq. 32: `X oplus tau = (Ad_X tau) oplus X`). It is the **algebraic realization of equivariance**, and also the transformation matrix for propagating perturbations/covariances across frames; Ex. 6 gives the closed-form adjoint matrix for SE(3).
|
|
37
|
+
|
|
38
|
+
### 5. Covariance Propagation -> Uncertainty on Manifolds (Eq. 52)
|
|
39
|
+
|
|
40
|
+
`Sigma = E[(X om Xbar)(X om Xbar)^T] in R^{m x m}` -- **the covariance lives in the tangent space R^n, not on the group**. Defining variance directly on the group is ill-posed; the tangent-space representation brings the uncertainty computations of Kalman filters / factor graphs back to familiar linear algebra.
|
|
41
|
+
|
|
42
|
+
Two additional directly usable "components":
|
|
43
|
+
- **SE(3) / SO(3)**: rigid body motion group / rotation group -- the unified differentiable representation of pose = rotation + translation, the standard language for cameras, point clouds, and robotic arm joints.
|
|
44
|
+
- **Composite manifolds (bundles, Eq. 84-90)**: assembling multi-pose + feature + calibration heterogeneous large states into non-interacting manifold blocks, with Jacobians **assembled block by block** (Eq. 89 is block-structured sparse), i.e., "assemble the Jacobian matrix block by block" in engineering practice.
|
|
45
|
+
|
|
46
|
+
## Problem Types Suited for Activation
|
|
47
|
+
|
|
48
|
+
- Prediction/regression targets carry **geometric constraints**: rotations, poses, unit vectors, SPD matrices -- forcing them into Euclidean MLPs breaks the constraints.
|
|
49
|
+
- Need **equivariance / invariance**: when the input undergoes rigid body transformations, the output should covary or remain invariant (point clouds, molecules, multi-view geometry).
|
|
50
|
+
- Need **explicit uncertainty**: pose estimation, sensor fusion, SLAM, visual odometry covariance propagation.
|
|
51
|
+
- **Iterative geometric optimization**: camera/point cloud registration, bundle adjustment, inverse kinematics, requiring gradient/Gauss-Newton on manifolds rather than in Euclidean space.
|
|
52
|
+
- States **evolve on Lie groups**: inertial pre-integration, motion models, differentiable physics/control.
|
|
53
|
+
|
|
54
|
+
## Possible Algorithmic Inspirations
|
|
55
|
+
|
|
56
|
+
- **SE(3)/SO(3) equivariant networks**: using group elements as hidden states, updating between layers via Exp/opus, transporting features via Ad; equivariance comes from group actions rather than data augmentation.
|
|
57
|
+
- **Manifold loss for pose regression**: using ominus (geodesic error) as the loss, rather than Euclidean MSE on rotation matrices/quaternions; naturally handles manifold topology (e.g., quaternion double cover).
|
|
58
|
+
- **Lie group optimizers**: rewriting Adam/Gauss-Newton in the retraction form "compute gradient in tangent space -> map back via Exp" (error-state approach, corresponding to the manifold EKF in Sec. V-A).
|
|
59
|
+
- **Differentiable registration / alignment**: camera pose, point cloud ICP, multi-view BA formulated as differentiable optimization layers on SE(3), trained end to end.
|
|
60
|
+
- **Manifold-parameterized output heads**: the network outputs an R^n tangent vector, mapped back to SO(3)/SE(3) via Exp, replacing the various ad-hoc orthogonalization schemes for 6D/9D rotation representations.
|
|
61
|
+
- **Uncertainty-aware fusion**: using the tangent-space covariance from Eq. 52 + Ad propagation to build learnable Kalman/factor-graph layers.
|
|
62
|
+
|
|
63
|
+
## GPU Friendliness Warning
|
|
64
|
+
|
|
65
|
+
> The sole authority for the acceptance gate: [`../gpu-friendly-math.en.md`](../gpu-friendly-math.en.md) (eight dimensions: D1 Tensorization, D2 GEMM-mappability, D3 Complexity, D4 Memory/KV, D5 Low-precision stability, D6 Parallelism & communication, D7 Sparse structure, D8 Operator fusion). Dimension-by-dimension scoring follows.
|
|
66
|
+
|
|
67
|
+
| # | Dimension | Rating | Notes |
|
|
68
|
+
|---|---|---|---|
|
|
69
|
+
| D1 | Tensorization | [v] | SO(3)/SE(3) exp/log have **closed forms** (Rodrigues), 3x3/4x4 small matrices, batched as `[B,3,3]` / `[B,4,4]` tensors, sample-independent |
|
|
70
|
+
| D2 | GEMM-mappability | [~] | 3x3/4x4 are too small to **saturate Tensor Cores**, bmm/batched small GEMM has low utilization and is easily memory-bandwidth-bound; fix: stack the batch dimension large, use specialized small kernels or einsum fusion |
|
|
71
|
+
| D3 | Complexity | [v] | O(1) per element, linear in batch |
|
|
72
|
+
| D4 | Memory | [v] | Elements are tiny; however, Jacobians/covariance matrices for high-DOF composite states can grow large (block-structured, still manageable) |
|
|
73
|
+
| D5 | Low-precision stability | [x] **critical** | exp/log contain terms like `sin(theta)/theta`, `(1-cos(theta))/theta^2`, which cause catastrophic cancellation at **theta->0** (division by zero) and **theta->pi** (log singularity); fp16/bf16 are highly prone to NaN. **Must** switch to Taylor expansion for small angles -- branching introduces warp divergence (hurts D1, D8) |
|
|
74
|
+
| D6 | Parallelism & communication | [~] | Per-sample exp/log is embarrassingly parallel [v]; however **discrete integration / motion chains on manifolds** (Sec. II-I, chained Exp products) are **serial recurrences**, long sequences must be rewritten as parallel scans to achieve parallelism |
|
|
75
|
+
| D7 | Sparse structure | [v] | Composite manifold Jacobians are **block-structured sparse** (Eq. 89), GPU-friendly |
|
|
76
|
+
| D8 | Operator fusion | [v] | Closed-form exp/log/Jacobians can be fused into a **single kernel**, avoiding materialization of intermediate small matrices |
|
|
77
|
+
|
|
78
|
+
**Expanded notes (closed-form vs. series / batching / whether small-matrix exponentials can be tensorized)**:
|
|
79
|
+
|
|
80
|
+
The GPU fate of `exp/log` in Lie theory depends entirely on "whether one is working with a low-dimensional group that admits a closed form."
|
|
81
|
+
|
|
82
|
+
- **Closed-form vs. series (Conclusion 1)**: The exponential map for SO(3) is precisely the **Rodrigues formula** `exp([theta]_x) = I + (sin(theta)/theta)[theta]_x + ((1-cos(theta))/theta^2)[theta]_x^2` (Ex. 4); SE(3) is similar with an additional left-Jacobian factor V(theta) -- both are **finite-term closed forms**, pure tensor algebra, per-sample independent, no data-dependent loops. The opposite case is the **general matrix exponential**: for arbitrary Lie groups there is no Rodrigues-style closed form, only Taylor series + scaling-and-squaring **iterative** approximation, with data-dependent step counts, divergent control flow, and difficult tensorization -- a classic "beautiful but not computable" case. Closed forms exist only for the small set SO(3)/SE(3)/SE(2)/S^1/S^3; **do not treat the general matrix exp as a cheap O(1) operator**.
|
|
83
|
+
- **Batching (Conclusion 2)**: stacking N rotations/poses into `[B,3,3]` / `[B,4,4]` for batched Exp/Log is clean element-wise + small bmm, which can be **fused with downstream operators into a single kernel**. Small-matrix exponentials **can** be tensorized -- batched stacking gives per-sample parallelism; but 3x3/4x4 are too small for bmm to saturate Tensor Cores, the value lies in "batchable and fusible" rather than "maxing out compute," and to improve utilization one should stack the batch large or use specialized small kernels.
|
|
84
|
+
- **Low-precision singularities (Conclusion 3, top risk)**: theta->0 (`sin(theta)/theta` division by zero) and theta->pi (log is non-unique) cause catastrophic cancellation, fp16/bf16 produce NaN directly. Before low-precision training, one **must** implement Taylor-expansion fallbacks for small angles and run deterministic reproducibility tests; the fallback branches introduce warp divergence, requiring `where`/mask implementations rather than data-dependent jumps.
|
|
85
|
+
- **Serial recurrence**: motion chains / discrete integration on manifolds (Sec. II-I) are serial recurrences of chained Exp products; long sequences must be rewritten as parallel scans to saturate the GPU.
|
|
86
|
+
|
|
87
|
+
## Which Design Lens to Invoke
|
|
88
|
+
|
|
89
|
+
- **symmetry (primary)**: Lie groups are by definition **continuous symmetry transformation groups**; this paper is the most direct mathematical ammunition for "symmetry/invariance -> equivariant networks."
|
|
90
|
+
- **duality (primary)**: exp/log equivalently transforms "curved nonlinear manifold" to "flat linear tangent space" -- a paradigmatic example of transforming a hard problem into an easy one (the dragon-slaying sword used for "chopping vegetables").
|
|
91
|
+
- **variational**: optimization on manifolds, retractions, error-state filtering (Sec. V-A).
|
|
92
|
+
- **geometric**: the modeling closed loop from reality (robotic/camera state + noise) to mathematics (manifold + covariance) to interpretation.
|
|
93
|
+
- **categorical**: abstracting from concrete matrices/quaternions to the unified "group" interface (the paper's own writing style -- generic formulation + grounded examples -- is itself an abstraction demonstration).
|
|
94
|
+
|
|
95
|
+
## Anti-patterns
|
|
96
|
+
|
|
97
|
+
- **Adding/subtracting rotations/poses directly in Euclidean space**: doing Euclidean MSE or linear interpolation on rotation matrices/quaternions -- breaks manifold constraints; use oplus/ominus and geodesic error instead.
|
|
98
|
+
- **Mixing left and right perturbations**: inconsistent conventions for right/left Jacobians, local/global frames, causing misalignment of covariances and gradients (the paper repeatedly emphasizes defaulting to the right version).
|
|
99
|
+
- **Assuming matrix exp is cheap and closed-form everywhere**: closed forms exist only for SO(3)/SE(3) and a few other groups; general groups require iterative series and cannot be treated as O(1) operators.
|
|
100
|
+
- **Not handling singularities in low precision**: failing to implement Taylor fallbacks for theta->0/pi causes fp16 training to produce NaN immediately.
|
|
101
|
+
- **Treating SE(3) as T(3)xSO(3)**: their tangent-space parameterizations differ (Ex. 7); whether translation and rotation are coupled changes the Jacobian, and misuse leads to systematic bias.
|
|
102
|
+
- **Over-application**: forcing Lie theory onto tasks that do not need uncertainty propagation or geometric constraints, adding complexity and singularity risk for no gain -- mathematical beauty does not mean it should be used.
|
|
103
|
+
|
|
104
|
+
## Deep Dive Entry
|
|
105
|
+
|
|
106
|
+
> **Bibliographic info**: Joan Sola, Jeremie Deray, Dinesh Atchuthan, *A micro Lie theory for state estimation in robotics*, arXiv:1812.01537v9, 2021. Companion open-source C++ library [manif](https://github.com/artivis/manif).
|
|
107
|
+
>
|
|
108
|
+
> **Activation method**: Place `A micro Lie theory.pdf` in the `math_book/` folder at the project root; the Agent can then automatically search the original text. The PDF is not distributed via npm/git (copyright reasons); obtain it independently.
|
|
109
|
+
|
|
110
|
+
> Full-fidelity lookup = have the Agent automatically retrieve the local PDF: `math_book/A micro Lie theory.pdf` (using `pdftotext` or Read PDF pages). The following are actual section/equation-block locations within that PDF:
|
|
111
|
+
|
|
112
|
+
1. **Sec. II-D Exponential map + Fig. 1**: exp/log and capital Exp/Log operators (Eq. 23-24) -- the manifold-to-tangent-space bridge and closed-form source; with Ex. 3 (SO(3) Lie algebra `[omega]_x`), Ex. 4 (SO(3) exp = Rodrigues).
|
|
113
|
+
2. **Sec. II-E Addition/subtraction operators (Eq. 25-28) + Sec. II-F Adjoint Ad_X (Eq. 30-35)**: "addition/subtraction" on manifolds and left/right perturbation conversions; Ex. 6 (SE(3) adjoint matrix).
|
|
114
|
+
3. **Sec. II-G Derivatives on Lie groups + Sec. III-A Chain rule**: right Jacobian (Eq. 41a-c), left Jacobian (Eq. 44), related through the adjoint -- the geometrically correct form for backpropagation/gradients.
|
|
115
|
+
4. **Sec. II-H Uncertainty on manifolds and covariance propagation (Eq. 52)**: Sigma defined on the tangent space; Sec. V-A manifold error-state EKF (Eq. 92-96) is the applied example.
|
|
116
|
+
5. **Appendix formula handbook**: SO(3) right/left Jacobian closed forms (Eq. 143-145), SE(3) Jacobians (citing Barfoot), and Sec. IV composite manifold block-wise Jacobians (Eq. 84-90, Ex. 7) -- direct lookup tables for engineering implementation, cross-referenced with the manif library.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 李理论速成 / A micro Lie theory
|
|
2
2
|
|
|
3
3
|
> **A micro Lie theory for state estimation in robotics** — Joan Solà, Jeremie Deray, Dinesh Atchuthan.
|
|
4
4
|
> arXiv:1812.01537v9 [cs.RO],2021-12-08,正文约 17 页 + 附录公式手册。配套开源 C++ 头文件库 **manif**(<https://github.com/artivis/manif>,实现 SO(2)/SO(3)/SE(2)/SE(3) 及解析雅可比)。
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
|
|
67
67
|
| # | 维度 | 评级 | 说明 |
|
|
68
68
|
|---|---|---|---|
|
|
69
|
-
| ① | 张量化 |
|
|
70
|
-
| ② | GEMM 可映射 |
|
|
71
|
-
| ③ | 复杂度 |
|
|
72
|
-
| ④ | 显存 |
|
|
73
|
-
| ⑤ | 低精度稳定 |
|
|
74
|
-
| ⑥ | 并行与通信 |
|
|
75
|
-
| ⑦ | 稀疏结构 |
|
|
76
|
-
| ⑧ | 算子融合 |
|
|
69
|
+
| ① | 张量化 | [v] | SO(3)/SE(3) 的 exp/log 有**闭式**(Rodrigues),3×3/4×4 小矩阵,批量化为 `[B,3,3]` / `[B,4,4]` 张量逐样本独立 |
|
|
70
|
+
| ② | GEMM 可映射 | [~] | 3×3/4×4 太小,**吃不满 Tensor Core**,bmm/批量小 GEMM 利用率低、易受访存带宽限制;改造:把 batch 维堆大、用专用小核或 einsum 融合 |
|
|
71
|
+
| ③ | 复杂度 | [v] | 每元素 O(1),随 batch 线性 |
|
|
72
|
+
| ④ | 显存 | [v] | 元素极小;但高自由度复合状态的雅可比/协方差矩阵会变大(块结构,仍可控) |
|
|
73
|
+
| ⑤ | 低精度稳定 | [x] **重点** | exp/log 含 `sinθ/θ`、`(1−cosθ)/θ²` 等项,在 **θ→0**(除零)与 **θ→π**(log 奇异)处灾难性抵消;fp16/bf16 极易 NaN。**必须**对小角做 Taylor 展开切换——而分支会带来 warp divergence(伤①⑧) |
|
|
74
|
+
| ⑥ | 并行与通信 | [~] | 逐样本 exp/log 是 embarrassingly parallel [v];但**流形上的离散积分/运动链**(§II-I,连乘 Exp)是**串行递推**,长序列需写成并行扫描(parallel scan)才能并行 |
|
|
75
|
+
| ⑦ | 稀疏结构 | [v] | 复合流形的雅可比是**块结构化稀疏**(式 89),对 GPU 友好 |
|
|
76
|
+
| ⑧ | 算子融合 | [v] | 闭式 exp/log/雅可比可融进**单 kernel**,避免物化中间小矩阵 |
|
|
77
77
|
|
|
78
78
|
**展开说明(闭式 vs 级数 / 批量化 / 小矩阵指数能否张量化)**:
|
|
79
79
|
|
|
@@ -86,11 +86,11 @@
|
|
|
86
86
|
|
|
87
87
|
## 该调用哪个思想透镜
|
|
88
88
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
89
|
+
- **symmetry(首选)**:李群本就是**连续对称变换群**,本文是"对称/不变性→等变网络"最直接的数学弹药。
|
|
90
|
+
- **duality(首选)**:exp/log 把"曲的非线性流形"等价变换到"平的线性切空间"——把难问题变换成易问题的范式样板(屠龙刀"切菜")。
|
|
91
|
+
- **variational**:流形上的优化、retraction、误差状态滤波(§V-A)。
|
|
92
|
+
- **geometric**:现实(机器人/相机状态+噪声)→数学(流形+协方差)→解释的建模闭环。
|
|
93
|
+
- **categorical**:从具体矩阵/四元数抽象出"群"的统一接口(论文正文泛型 + 例子接地的写法本身就是抽象示范)。
|
|
94
94
|
|
|
95
95
|
## 反模式
|
|
96
96
|
|
|
@@ -103,13 +103,13 @@
|
|
|
103
103
|
|
|
104
104
|
## 深挖入口
|
|
105
105
|
|
|
106
|
-
>
|
|
106
|
+
> **书目信息**:Joan Solà, Jérémie Deray, Dinesh Atchuthan, *A micro Lie theory for state estimation in robotics*, arXiv:1812.01537v9, 2021. 配套开源 C++ 库 [manif](https://github.com/artivis/manif)。
|
|
107
107
|
>
|
|
108
108
|
> **启用方式**:将 `A micro Lie theory.pdf` 放入项目根目录的 `math_book/` 文件夹,Agent 即可自动搜索原文。PDF 不随 npm/git 分发(版权原因),需自行获取。
|
|
109
109
|
|
|
110
110
|
> 全保真回查 = 让 Agent 自动检索本地 PDF:`math_book/A micro Lie theory.pdf`(用 `pdftotext` 或 Read PDF pages)。下列为该 PDF 内的真实章节/公式块定位:
|
|
111
111
|
|
|
112
|
-
1. **§II-D 指数映射 + Fig. 1**:exp/log 与大写 Exp/Log 算子(式 23–24
|
|
112
|
+
1. **§II-D 指数映射 + Fig. 1**:exp/log 与大写 Exp/Log 算子(式 23–24)——流形-> 切空间桥梁与闭式来源;配 Ex. 3(SO(3) 的李代数 `[ω]×`)、Ex. 4(SO(3) 的 exp = Rodrigues)。
|
|
113
113
|
2. **§II-E 加减算子(式 25–28)+ §II-F 伴随 Ad_X(式 30–35)**:流形上的"加/减"与左右扰动互转;Ex. 6(SE(3) 的伴随矩阵)。
|
|
114
114
|
3. **§II-G 李群上的导数 + §III-A 链式法则**:右雅可比(式 41a–c)、左雅可比(式 44),二者由伴随相联——反传/梯度的几何正确形式。
|
|
115
115
|
4. **§II-H 流形上的不确定性与协方差传播(式 52)**:Σ 定义在切空间;§V-A 流形误差状态 EKF(式 92–96)是落地范例。
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Optimization (Including ML Applications)
|
|
2
|
+
|
|
3
|
+
> **An Introduction to Optimization, With Applications to Machine Learning** (5th Edition, 2024)
|
|
4
|
+
> Edwin K. P. Chong, Wu-Sheng Lu, Stanislaw H. Zak -- John Wiley & Sons (Hardback ISBN 9781119877639)
|
|
5
|
+
>
|
|
6
|
+
> This file is an "activation reference": synthesized distillation, engineering-oriented, not a verbatim excerpt.
|
|
7
|
+
> Goal -- extract the structures from this classic optimization textbook that **can be applied to algorithms / GPU / training Infra**.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
The fifth edition of a classic continuous optimization textbook. Compared to earlier editions, the largest addition is a completely new **Part V "Optimization in Machine Learning"**, which fully integrates first-order/second-order optimality, duality, KKT, and convergence theory with training practices such as SGD/SVM/PCA. The book has 31 chapters organized into five parts.
|
|
12
|
+
|
|
13
|
+
Actual chapter map:
|
|
14
|
+
|
|
15
|
+
- **Part I -- Mathematical Review (Ch 1-5)**
|
|
16
|
+
- Ch 1 Proof methods and notation; Ch 2 Vector spaces and matrices (rank, inner products and norms).
|
|
17
|
+
- Ch 3 Transformations: eigenvalues/eigenvectors, orthogonal projections, quadratic forms S3.4, matrix norms S3.5.
|
|
18
|
+
- Ch 4 Geometry: hyperplanes, **convex sets S4.3**, polytopes and polyhedra.
|
|
19
|
+
- Ch 5 Calculus: derivative matrices S5.3, **level sets and gradients S5.5**, Taylor series S5.6.
|
|
20
|
+
- **Part II -- Unconstrained Optimization (Ch 6-14)**
|
|
21
|
+
- Ch 6 First-order/second-order necessary and sufficient conditions for local minima.
|
|
22
|
+
- Ch 7 One-dimensional search: golden section, Fibonacci, bisection, Newton, secant, line search.
|
|
23
|
+
- **Ch 8 Gradient methods** (steepest descent S8.2, convergence analysis S8.3).
|
|
24
|
+
- **Ch 9 Newton's method** (Levenberg-Marquardt S9.3, nonlinear least squares).
|
|
25
|
+
- Ch 10 Conjugate direction/conjugate gradient methods; **Ch 11 Quasi-Newton methods** (inverse Hessian approximation, DFP S11.4, **BFGS S11.5**).
|
|
26
|
+
- Ch 12 Solving linear equations (least squares, RLS, Kaczmarz, minimum-norm solutions).
|
|
27
|
+
- **Ch 13 Neural networks and backpropagation** (single-neuron training S13.2, Backprop S13.3).
|
|
28
|
+
- Ch 14 Global search: Nelder-Mead, simulated annealing, PSO, genetic algorithms.
|
|
29
|
+
- **Part III -- Linear Programming (Ch 15-19)**
|
|
30
|
+
- Ch 15 LP fundamentals and geometry; Ch 16 Simplex method.
|
|
31
|
+
- **Ch 17 LP duality** (dual LP, matrix games).
|
|
32
|
+
- Ch 18 Non-simplex/interior-point methods (Khachiyan, affine scaling, Karmarkar); Ch 19 Integer programming.
|
|
33
|
+
- **Part IV -- Nonlinear Constrained Optimization (Ch 20-25)**
|
|
34
|
+
- Ch 20 Equality constraints: tangent/normal spaces S20.3, **Lagrange conditions S20.4**, second-order conditions.
|
|
35
|
+
- **Ch 21 Inequality constraints and KKT** (KKT S21.1, second-order conditions S21.2).
|
|
36
|
+
- **Ch 22 Convex optimization** (convex functions S22.2, convex problems S22.3, SDP/LMI S22.4).
|
|
37
|
+
- **Ch 23 Lagrangian duality** (weak/strong duality, duality gap S23.4.6, Slater S23.6.3, saddle points).
|
|
38
|
+
- Ch 24 Constrained optimization algorithms (projection S24.2, **projected gradient S24.3**, Armijo S24.4.4, augmented Lagrangian S24.5, penalty methods S24.6).
|
|
39
|
+
- Ch 25 Multi-objective / robust LP (Pareto, uncertainty).
|
|
40
|
+
- **Part V -- Optimization in ML (Ch 26-31)**
|
|
41
|
+
- Ch 26 Feature engineering, PCA, SVD, linear autoencoders.
|
|
42
|
+
- **Ch 27 SGD algorithms** (SGD S27.1, variance reduction **SVRG S27.2**, **distributed SVRG and communication/computation tradeoffs S27.3**).
|
|
43
|
+
- Ch 28 Linear regression (regularization S28.3, cross-validation); Ch 29 Logistic regression / Softmax.
|
|
44
|
+
- **Ch 30 SVM** (hinge loss, hard/soft margin); **Ch 31 Kernel methods and K-Means**.
|
|
45
|
+
|
|
46
|
+
## Core Structures Transferable to AI/Infra
|
|
47
|
+
|
|
48
|
+
- **First-order optimality + gradient geometry (Ch 6, S5.5)**
|
|
49
|
+
- Gradient is perpendicular to level sets and is the steepest ascent direction -- the axiomatic root of all training optimizers.
|
|
50
|
+
- `nabla f = 0` is the stopping criterion; saddle points / non-convexity are the central pain points of modern deep learning.
|
|
51
|
+
- **Convergence analysis framework (Ch 8 S8.3)**
|
|
52
|
+
- Uses the condition number kappa = lambda_max/lambda_min to characterize the convergence rate of steepest descent.
|
|
53
|
+
- Explains "why ill-conditioned networks are hard to train, why normalization / preconditioning is needed."
|
|
54
|
+
- **Second-order curvature and damping (Ch 9)**
|
|
55
|
+
- Newton's method uses the Hessian to provide affine-invariant step sizes and directions.
|
|
56
|
+
- Levenberg-Marquardt's `(H+mu I)` damping = trust-region idea, the ancestor of Adam's `epsilon` and second-order optimizers.
|
|
57
|
+
- **Quasi-Newton low-rank updates (Ch 11)**
|
|
58
|
+
- BFGS/DFP uses only gradient differences, maintaining an inverse Hessian approximation via rank-1/rank-2 updates.
|
|
59
|
+
- Direct intellectual ancestor of L-BFGS, K-FAC, and Shampoo.
|
|
60
|
+
- **Matrix-free second-order methods (Ch 10)**
|
|
61
|
+
- Conjugate gradient requires only Hessian-vector products without storing the full Hessian; corresponds to autodiff HVP (Hessian-free).
|
|
62
|
+
- **Constraint geometry (Ch 20-21, 24)**
|
|
63
|
+
- Tangent/normal spaces -> Lagrange/KKT -> projected gradient + penalty / augmented Lagrangian.
|
|
64
|
+
- Forms a complete toolkit for "training with constraints."
|
|
65
|
+
- **Duality and saddle points (Ch 17, 23)**
|
|
66
|
+
- Strong duality <=> minimax = maximin; KKT, complementary slackness, Slater conditions.
|
|
67
|
+
- Min-max training (GAN / adversarial robustness) and SVM duality both fall here.
|
|
68
|
+
- **Stochastic and distributed methods (Ch 27)**
|
|
69
|
+
- SGD's unbiased gradient estimation, SVRG variance reduction.
|
|
70
|
+
- **Explicit "communication vs. computation" tradeoff in distributed settings** -- the theoretical root of data-parallel training.
|
|
71
|
+
- **Low-rank / spectral methods (Ch 26, S3.4)**
|
|
72
|
+
- SVD/PCA/linear autoencoders, quadratic forms and spectra -- the mathematical foundation of LoRA, KV compression, and spectral normalization.
|
|
73
|
+
|
|
74
|
+
## Problem Types Suited for Activation
|
|
75
|
+
|
|
76
|
+
- Selecting / designing optimizers, or explaining training dynamics (why divergence, oscillation, or stagnation at saddle points occurs).
|
|
77
|
+
- Diagnosing ill-conditioning and slow convergence: quantifying "hard to train" via the condition number kappa.
|
|
78
|
+
- Training with constraints: weight-norm balls, spectral norms, safety / budget constraints, requiring projection or penalty methods.
|
|
79
|
+
- Min-max / adversarial / dual perspectives: replacing a hard primal with an easier dual (e.g., kernel Gram matrix).
|
|
80
|
+
- Communication-computation tradeoffs, gradient compression, and variance reduction in distributed training.
|
|
81
|
+
- Scenarios requiring second-order information but unable to compute the full Hessian (curvature-adaptive preconditioning).
|
|
82
|
+
|
|
83
|
+
## Possible Algorithmic Inspirations
|
|
84
|
+
|
|
85
|
+
- **Adaptive optimizers**
|
|
86
|
+
- Levenberg-Marquardt's `(H+mu I)` damping -> Adam's `epsilon`, trust regions, adaptive learning rates.
|
|
87
|
+
- Making "curvature / damping" explicit rather than staying with purely heuristic hyperparameter tuning.
|
|
88
|
+
- **Feasible second-order for large models**
|
|
89
|
+
- L-BFGS: Store only the most recent m gradient pairs (low-rank history, memory O(md)).
|
|
90
|
+
- Hessian-free: Autodiff HVP + CG (matrix-free, no need to materialize the Hessian).
|
|
91
|
+
- K-FAC / Shampoo: Approximate the Hessian as **block-diagonal / Kronecker factors**, reducing each block to a small GEMM.
|
|
92
|
+
- **Efficient solving via the dual perspective**
|
|
93
|
+
- SVM converts a high-dimensional primal into a dual that depends only on the kernel Gram matrix (Ch 30-31), a big win when sample count << dimensionality.
|
|
94
|
+
- Dual decomposition of constrained problems is naturally parallelizable.
|
|
95
|
+
- **Constrained training**
|
|
96
|
+
- Projected gradient (S24.3) for norm-ball / spectral-norm constraints (weight clipping, spectral normalization).
|
|
97
|
+
- Augmented Lagrangian / penalty methods (S24.5-S24.6) soften hard constraints into differentiable regularization.
|
|
98
|
+
- **Variance reduction / large batch**
|
|
99
|
+
- SVRG's (S27.2) control variate idea -> gradient accumulation, stability analysis of large-batch training.
|
|
100
|
+
- **Distributed training**
|
|
101
|
+
- S27.3 "Communication vs. Computation" directly corresponds to all-reduce and computation overlap, gradient compression, federated / data security.
|
|
102
|
+
|
|
103
|
+
## GPU Friendliness Warning
|
|
104
|
+
|
|
105
|
+
> The following item-by-item evaluation uses the **eight-dimension scorecard** from `../gpu-friendly-math.en.md` (read that first).
|
|
106
|
+
> Conclusion: The book's first-order / stochastic / low-rank content is naturally GPU-friendly; second-order methods and search-based methods require heavy adaptation or elimination.
|
|
107
|
+
|
|
108
|
+
- **Full Hessian in second-order methods (Ch 9, 11)**
|
|
109
|
+
- Violates **D4**: Dense Hessian is O(d^2), impossible to materialize for hundreds of millions of parameters.
|
|
110
|
+
- Violates **D2**: Inversion / factorization is not batched-GEMM friendly.
|
|
111
|
+
- Violates **D5**: Ill-conditioned inversion causes catastrophic cancellation under bf16/fp16.
|
|
112
|
+
- Adaptation: Matrix-free HVP + CG, L-BFGS low-rank, K-FAC block-diagonal -> restores **D2/D4** friendliness.
|
|
113
|
+
- **Line search (Ch 7 golden section / Armijo S24.4.4)**
|
|
114
|
+
- Violates **D1**: Essentially a scalar loop + data-dependent branching (step-by-step comparison of function values).
|
|
115
|
+
- Violates **D8**: Frequent small kernels, control-flow divergence.
|
|
116
|
+
- Adaptation: Large models almost universally use scheduled step sizes (warmup + cosine) instead of step-by-step line search.
|
|
117
|
+
- **First-order / SGD (Ch 8, 27)**
|
|
118
|
+
- **D1/D2 friendly**: Gradients = tensor algebra, expressible as GEMM.
|
|
119
|
+
- **D6** is good: Data-parallel all-reduce can overlap with backprop -- the fundamental reason this is the default approach for large models.
|
|
120
|
+
- **Global search (Ch 14: GA/SA/PSO)**
|
|
121
|
+
- Violates **D1**: Non-differentiable, discrete stochastic search, blocks end-to-end gradient training.
|
|
122
|
+
- **D6** is also poor: Inter-population dependencies, hard to parallelize. Only suitable for black-box hyperparameter search, not for the training inner loop.
|
|
123
|
+
- **LP simplex / interior-point methods (Ch 16, 18)**
|
|
124
|
+
- Simplex row operations are acceptable; interior-point methods require solving a linear system at each step, **D2/D6** limited by factorization and communication.
|
|
125
|
+
- Suitable for medium-scale constrained subproblems, not for placement inside every training step.
|
|
126
|
+
- **Projections (S24.2)**
|
|
127
|
+
- Norm-ball / box projections are cheap elementwise operations (**D1/D8** friendly).
|
|
128
|
+
- General polyhedral projections require solving a QP (**D2** degrades).
|
|
129
|
+
- **Convergence depends on condition number kappa**
|
|
130
|
+
- Large kappa -> **D5** is further amplified at low precision (ill-conditioned gradients).
|
|
131
|
+
- Must pair with normalization / preconditioning; otherwise bf16 training diverges.
|
|
132
|
+
|
|
133
|
+
## Which Thinking Lens to Invoke
|
|
134
|
+
|
|
135
|
+
- **variational** (primary): The complete objective-constraint-optimality-convergence framework; this book is its core source; translate real-world tasks (classification / regression / constraints) into solvable optimization problems.
|
|
136
|
+
- **algorithmic**: Convergence properties, complexity, step size / stopping criteria for iterative algorithms.
|
|
137
|
+
- **duality**: Duality, kernel methods, variable substitution, SVD/PCA -- "equivalence transformations to simplify problems."
|
|
138
|
+
- **probabilistic**: SGD stochastic gradients, SVRG variance reduction, cross-validation / regularization.
|
|
139
|
+
|
|
140
|
+
## Anti-patterns
|
|
141
|
+
|
|
142
|
+
- Applying **full-Hessian Newton** directly to large models -- O(d^2) memory and inversion blow up immediately (must use matrix-free / low-rank / block-diagonal).
|
|
143
|
+
- Using **line search** to tune step sizes at every step of a large model -- scalar serial, control-flow divergence, burns through compute; should switch to scheduled learning rates.
|
|
144
|
+
- Using **GA/SA/PSO to train neural networks** -- non-differentiable, cannot parallelize, extremely sample-inefficient; limited to black-box hyperparameter search only.
|
|
145
|
+
- Discussing convergence while **ignoring the condition number kappa** -- expecting low-precision convergence without normalization / preconditioning is wishful thinking.
|
|
146
|
+
- Forcing **LP simplex thinking** onto continuously differentiable problems.
|
|
147
|
+
- Treating **duality / KKT as universal** -- non-convex problems typically lack strong duality and have duality gaps (S23.4.6); KKT is only a necessary condition.
|
|
148
|
+
- Treating this "activation reference" as a source of rigorous proofs -- details and theorem conditions must be verified against the original book.
|
|
149
|
+
|
|
150
|
+
## Deep-dive Entry
|
|
151
|
+
|
|
152
|
+
> **Bibliographic information**: Edwin K. P. Chong, Wu-Sheng Lu, Stanislaw H. Zak, *An Introduction to Optimization, With Applications to Machine Learning*, 5th Edition, John Wiley & Sons, 2024. ISBN 978-1-119-87763-9.
|
|
153
|
+
>
|
|
154
|
+
> **Activation method**: Place `An Introduction to Optimization With Applications to Machine Learning.pdf` in the `math_book/` folder at the project root; the Agent can then automatically search the original text. The PDF is not distributed via npm/git (copyright reasons) and must be obtained separately.
|
|
155
|
+
|
|
156
|
+
Full-fidelity lookup = have the Agent directly search the local PDF
|
|
157
|
+
`math_book/An Introduction to Optimization With Applications to Machine Learning.pdf`, locating by actual chapter numbers:
|
|
158
|
+
|
|
159
|
+
- **Ch 8 Gradient Methods** (S8.3 convergence analysis, condition numbers) + **Ch 11 Quasi-Newton Methods** (S11.5 BFGS) -- Optimizers and feasible second-order methods.
|
|
160
|
+
- **Ch 22 Convex Optimization Problems** (S22.2 convex functions, S22.4 SDP/LMI) -- Convexity criteria and semidefinite programming.
|
|
161
|
+
- **Ch 23 Lagrangian Duality** (S23.5 strong duality, S23.6.3 Slater conditions) + **Ch 21 KKT Conditions** -- Duality / KKT / saddle points.
|
|
162
|
+
- **Ch 24 Algorithms for Constrained Optimization** (S24.3 projected gradient, S24.5 augmented Lagrangian, S24.6 penalty methods) -- Constrained training algorithms.
|
|
163
|
+
- **Ch 27 Stochastic Gradient Descent Algorithms** (S27.1 SGD, S27.2 SVRG, S27.3 distributed and communication/computation) -- Large-scale training core.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 最优化(含 ML 应用)/ Optimization with ML
|
|
2
2
|
|
|
3
3
|
> **An Introduction to Optimization, With Applications to Machine Learning** (5th Edition, 2024)
|
|
4
4
|
> Edwin K. P. Chong, Wu-Sheng Lu, Stanisław H. Żak — John Wiley & Sons(Hardback ISBN 9781119877639)
|
|
@@ -106,37 +106,36 @@
|
|
|
106
106
|
> 结论:本书的一阶 / 随机 / 低秩部分天然友好;二阶法与搜索类方法需重度改造或淘汰。
|
|
107
107
|
|
|
108
108
|
- **二阶法的全 Hessian(Ch 9, 11)**
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
- 改造:matrix-free HVP + CG、L-BFGS 低秩、K-FAC 块对角 →
|
|
109
|
+
- 违反**D4**:稠密 Hessian 是 O(d²),亿级参数无法物化。
|
|
110
|
+
- 违反**D2**:求逆 / 分解非 batched-GEMM 友好。
|
|
111
|
+
- 违反**D5**:病态求逆在 bf16/fp16 灾难性抵消。
|
|
112
|
+
- 改造:matrix-free HVP + CG、L-BFGS 低秩、K-FAC 块对角 → 重回**D2/D4** 友好。
|
|
113
113
|
- **线搜索(Ch 7 黄金分割 / Armijo §24.4.4)**
|
|
114
|
-
-
|
|
115
|
-
-
|
|
114
|
+
- 违反**D1**:本质是标量循环 + 数据相关分支(逐步比较函数值)。
|
|
115
|
+
- 违反**D8**:频繁小 kernel、控制流发散。
|
|
116
116
|
- 改造:大模型几乎都用调度式步长(warmup + cosine)替代逐步线搜索。
|
|
117
117
|
- **一阶 / SGD(Ch 8, 27)**
|
|
118
|
-
-
|
|
119
|
-
-
|
|
118
|
+
- **D1/D2 友好**:梯度 = 张量代数、可写成 GEMM。
|
|
119
|
+
- **D6**良好:数据并行 all-reduce 可与反向 overlap——大模型默认路线的根本原因。
|
|
120
120
|
- **全局搜索(Ch 14:GA/SA/PSO)**
|
|
121
|
-
-
|
|
122
|
-
-
|
|
121
|
+
- 违反**D1**:不可微、离散随机搜索,阻断端到端梯度训练。
|
|
122
|
+
- **D6** 也差:种群间依赖、难并行映射。仅适合黑盒超参搜索,不进训练内环。
|
|
123
123
|
- **LP 单纯形 / 内点法(Ch 16, 18)**
|
|
124
|
-
-
|
|
124
|
+
- 单纯形的行运算尚可;内点法每步要解线性系统,**D2/D6** 受限于分解与通信。
|
|
125
125
|
- 适合中等规模约束子问题,不适合放进每个训练 step。
|
|
126
126
|
- **投影(§24.2)**
|
|
127
|
-
- norm-ball / box 投影是廉价 elementwise
|
|
128
|
-
- 一般多面体投影要解 QP
|
|
127
|
+
- norm-ball / box 投影是廉价 elementwise(**D1/D8** 友好)。
|
|
128
|
+
- 一般多面体投影要解 QP(**D2** 退化)。
|
|
129
129
|
- **收敛依赖条件数 κ**
|
|
130
|
-
- κ 大 →
|
|
130
|
+
- κ 大 → **D5** 在低精度下被进一步放大(病态梯度)。
|
|
131
131
|
- 必须配归一化 / 预条件,否则 bf16 训练发散。
|
|
132
132
|
|
|
133
133
|
## 该调用哪个思想透镜
|
|
134
134
|
|
|
135
|
-
- **
|
|
136
|
-
- **algorithmic
|
|
137
|
-
- **
|
|
138
|
-
- **
|
|
139
|
-
- **probability-statistics**:SGD 随机梯度、SVRG 方差缩减、交叉验证 / 正则化。
|
|
135
|
+
- **variational**(主):目标-约束-最优性-收敛的完整框架,本书是其核心出处;把现实任务(分类 / 回归 / 约束)翻译成可解的优化问题。
|
|
136
|
+
- **algorithmic**:迭代算法的收敛性、复杂度、步长 / 停机判据。
|
|
137
|
+
- **duality**:对偶、核技巧、变量替换、SVD/PCA——"等价转换简化问题"。
|
|
138
|
+
- **probabilistic**:SGD 随机梯度、SVRG 方差缩减、交叉验证 / 正则化。
|
|
140
139
|
|
|
141
140
|
## 反模式
|
|
142
141
|
|
|
@@ -150,7 +149,7 @@
|
|
|
150
149
|
|
|
151
150
|
## 深挖入口
|
|
152
151
|
|
|
153
|
-
>
|
|
152
|
+
> **书目信息**:Edwin K. P. Chong, Wu-Sheng Lu, Stanisław H. Żak, *An Introduction to Optimization, With Applications to Machine Learning*, 5th Edition, John Wiley & Sons, 2024. ISBN 978-1-119-87763-9.
|
|
154
153
|
>
|
|
155
154
|
> **启用方式**:将 `An Introduction to Optimization With Applications to Machine Learning.pdf` 放入项目根目录的 `math_book/` 文件夹,Agent 即可自动搜索原文。PDF 不随 npm/git 分发(版权原因),需自行获取。
|
|
156
155
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Smooth Manifolds
|
|
2
|
+
|
|
3
|
+
> **Book**: John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition. Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8 / DOI 10.1007/978-1-4419-9982-5. MSC 53-01 / 58-01 / 57-01.
|
|
4
|
+
> **Positioning**: Equipping objects that "locally look like Euclidean space but can bend globally" (manifolds) with calculus (tangent spaces, vector fields, differential forms, flows, Lie derivatives) -- the mathematical mother of **manifold optimization, latent-space geometry, and differentiable structures**.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
Smooth manifold = a space that can be locally linearized by coordinate charts, with charts glued together by smooth transition maps. The main thread of the book: **first transplant Euclidean calculus onto curved spaces, then study geometric and topological invariants on them**. For AI, the most valuable part is the "differentiable machinery" in the first half -- tangent/cotangent spaces, vector fields, flows, Riemannian metrics.
|
|
9
|
+
|
|
10
|
+
Actual chapter map (2nd ed., chapter numbers match the book):
|
|
11
|
+
|
|
12
|
+
- **Ch 1-2 Smooth Manifolds / Smooth Maps**: topological manifolds, smooth structures (atlases), smooth maps, partitions of unity. -> The language of local linearization + global patching.
|
|
13
|
+
- **Ch 3 Tangent Vectors**: tangent space T_pM, differential / pushforward df_p, tangent bundle TM. -> **The core of local linearization**, the geometric prototype of backpropagation.
|
|
14
|
+
- **Ch 4-5 Submersions, Immersions, Embeddings / Submanifolds**: constant rank theorem, embeddings, regular level sets -> submanifolds. -> Constraint sets = submanifolds.
|
|
15
|
+
- **Ch 6 Sard's Theorem**: critical values have measure zero, Whitney embedding theorem (n-dimensional manifolds embed in R^{2n}). -> Embedding dimensions / manifold hypothesis.
|
|
16
|
+
- **Ch 7 Lie Groups**: both group and manifold (SO(n), U(n), GL(n), Stiefel...), Lie algebra = tangent space at the identity. -> Orthogonal/unitary weight constraints, equivariance.
|
|
17
|
+
- **Ch 8-9 Vector Fields / Integral Curves and Flows**: vector fields, integral curves, flows (one-parameter diffeomorphism groups), Lie derivatives and Lie brackets [X,Y]. -> **The mother structure of Neural ODE / diffusion / continuous normalizing flows**.
|
|
18
|
+
- **Ch 10-12 Vector Bundles / Cotangent Bundle / Tensors**: bundles, covector fields (1-forms), pullbacks, tensors. -> The true nature of gradients is covectors.
|
|
19
|
+
- **Ch 13 Riemannian Metrics**: inner product at each point, length/distance/volume, tangent-cotangent isomorphism (musical sharp/flat, raising/lowering indices). -> **The metric source for natural gradients / Riemannian optimization**.
|
|
20
|
+
- **Ch 14-16 Differential Forms / Orientations / Integration**: k-forms, wedge products, exterior derivative d (d^2=0), orientations, volume forms, integration on manifolds and change of variables. -> The log-det-Jacobian in normalizing flows = pullback of volume forms.
|
|
21
|
+
- **Ch 17-18 De Rham Cohomology / de Rham Theorem**: closed forms modulo exact forms = topological invariants read from differential data. -> Global obstructions / cohomological regularization.
|
|
22
|
+
- **Ch 19-22 Distributions & Foliations / Exponential Map / Quotient Manifolds / Symplectic Manifolds**: integrable distributions (Frobenius), exponential map (retraction prototype), quotient manifolds (Grassmannian etc.), symplectic forms and Hamiltonian flows. -> Retractions, quotient-space constraints, symplectic integrators / HMC.
|
|
23
|
+
|
|
24
|
+
**Author's stated boundary (preface)**: the book stops at "building the tools," **deliberately omitting** connections, geodesics, curvature, fiber bundles, and Hodge theory -- these are covered in Lee's sequel *Riemannian Manifolds*. So if a problem truly requires the deep geometry of curvature/parallel transport, this book only provides the entry point via metrics and the exponential map; one must continue with a Riemannian geometry text.
|
|
25
|
+
|
|
26
|
+
## Core Structures Transferable to AI/Infra
|
|
27
|
+
|
|
28
|
+
- **Tangent space = local linearization of parameter/latent space**. `df_p: T_pM -> T_{f(p)}N` is the Jacobian / pushforward (corresponding to JVP / forward-mode AD); backpropagation = pullback on the cotangent bundle (VJP = vector-Jacobian product = pullback of covectors), i.e., pullback along composed maps (the geometric version of the chain rule). All first-order methods live in the tangent space.
|
|
29
|
+
- **Gradients are covectors, not vectors**. Autodiff produces 1-forms (elements of the cotangent space); to obtain a descent direction (tangent vector) one must use the **metric to raise indices** (sharp). Euclidean metric -> ordinary gradient; Fisher metric -> natural gradient. **This is the manifold-level root cause of natural gradients / mirror descent**.
|
|
30
|
+
- **Constraint sets = submanifolds**. Regular level set theorem: when g is a submersion, the solution set `g(x)=c` is a smooth submanifold; constrained optimization = unconstrained optimization on a submanifold.
|
|
31
|
+
- **Lie groups = differentiable symmetry groups**. SO(n)/U(n)/Stiefel/Grassmannian are all manifolds; their Lie algebras (e.g., skew-symmetric matrices so(n)) are linear spaces, mapped back to the group via `exp` -> **reparameterize "constrained weights" as "unconstrained Lie algebra + exp"**.
|
|
32
|
+
- **Flows = time-parameterized families of diffeomorphisms**. Learning a vector field + integrating along it = Neural ODE / continuous normalizing flows / diffusion sampling. Flow invertibility and volume preservation directly correspond to model properties.
|
|
33
|
+
- **Riemannian metric = designable/learnable "local geometry"**. It determines distances, angles, volumes, and orthogonality relations; changing the metric changes optimization trajectories and sampling measures.
|
|
34
|
+
- **Differential forms + volume forms = the language of change of variables**. The `log|det J|` term in normalizing flows is precisely the pullback of a volume form under a map; choosing the right structure (triangular/coupling Jacobians) makes it cheap.
|
|
35
|
+
|
|
36
|
+
## Problem Types Suited for Activation
|
|
37
|
+
|
|
38
|
+
- Parameters should satisfy **geometric constraints**: orthogonality, unit norm, unit determinant, SPD, low-rank manifolds, hyperbolic/spherical latent spaces.
|
|
39
|
+
- Optimization is more natural on **curved spaces**: subspace learning on Stiefel/Grassmannian, rotation/pose estimation, hyperspherical representations.
|
|
40
|
+
- Need **structure-preserving dynamics**: invertible generative models, volume-preserving flows, Hamiltonian systems, energy-conserving long-horizon simulations.
|
|
41
|
+
- **Latent space geometry**: interpolation, geodesics, metric learning, clustering/nearest-neighbor on manifolds.
|
|
42
|
+
- Need to upgrade from correlations to **topological invariants**: detecting "holes" in latent spaces, global obstructions, cohomology-based consistency regularization.
|
|
43
|
+
|
|
44
|
+
## Possible Algorithmic Inspirations
|
|
45
|
+
|
|
46
|
+
- **Riemannian/manifold optimizers**: transplanting Adam/SGD onto Stiefel, Grassmannian, SPD, hyperbolic spaces -- projecting gradients to the tangent space + retraction back to the manifold.
|
|
47
|
+
- **Orthogonal/Stiefel constrained weights**: using Cayley transforms or QR-retractions to maintain `W^T W = I`, mitigating gradient explosion/vanishing in RNNs/deep networks; or using so(n) Lie algebra + matrix-exp to reparameterize rotations.
|
|
48
|
+
- **Geodesic interpolation**: using closed-form geodesics for interpolation and mixing in spherical/hyperbolic/SPD latent spaces, replacing Euclidean linear interpolation.
|
|
49
|
+
- **Normalization on manifolds**: interpreting LayerNorm/feature normalization as projection onto spheres/unit manifolds; hyperspherical softmax and spectral normalization are instances of this.
|
|
50
|
+
- **Neural ODE / continuous normalizing flows / diffusion**: learning a vector field X_theta, solving via flows; structured Jacobians make `log-det` cheap.
|
|
51
|
+
- **Symplectic integrators / HMC**: using leapfrog-style symplectic, volume-preserving explicit updates for sampling and "optimization with momentum," stable over long horizons.
|
|
52
|
+
- **Equivariant networks**: using Lie group actions + quotient manifolds to bake symmetries into the architecture (geometric deep learning).
|
|
53
|
+
|
|
54
|
+
## GPU Friendliness Warning
|
|
55
|
+
|
|
56
|
+
> The sole authority for the acceptance gate: the **eight dimensions** in `../gpu-friendly-math.en.md`. The success or failure of manifold methods almost entirely hinges on one point: **whether the retraction / exponential map can be tensorized and expressed as GEMM, or must be solved iteratively.**
|
|
57
|
+
|
|
58
|
+
Dimension-by-dimension comparison:
|
|
59
|
+
|
|
60
|
+
- **D1-D2 Tensorization / GEMM**: tangent-space operations (pushforward/pullback, Jacobian-vector products, projecting gradients to the tangent space) are **naturally batched GEMM** [v] -- backpropagation itself is pullback (VJP), which is extremely GPU-friendly. **However**, retractions/exp typically require QR, eigendecomposition, matrix exponentials, or small-matrix inverses: QR/eig are **not clean GEMM**, they are decompositions with serial dependencies (cuSOLVER batched small matrices are acceptable, but large matrices are O(n^3) with poor parallelism) -> **reformable** rather than natively friendly.
|
|
61
|
+
- **D3 Complexity**: geodesic distances, parallel transport, general `log|det J|` are all O(n^3) or worse. **Fix**: restrict to manifolds with closed-form geodesics (spheres/hyperbolic/SO(3)); use triangular/coupling layers in normalizing flows so that log-det reduces to a diagonal sum (O(n)).
|
|
62
|
+
- **D5 Low-precision**: [~] **biggest pitfall**. Matrix `exp / log / sqrt`, eigendecompositions, and the affine-invariant metric for SPD are **catastrophically unstable** under bf16/fp16, often silently requiring fp32/fp64. Manifold primitives frequently "appear to run but have numerically diverged long ago."
|
|
63
|
+
- **D6 Parallelism & communication**: the squaring chain in scaling-and-squaring, ODE integration steps, Householder/QR all have **serial recurrences**, making cross-SM/device overlap difficult. Positive counter-example: explicit symplectic integrators (leapfrog) are highly parallel [v].
|
|
64
|
+
- **D4/D7/D8 Memory / Sparsity / Fusion**: if Lie algebra/rotation parameterizations are restricted to **small matrices or block-diagonal** structures (e.g., per-head rotations, SO(3) Rodrigues closed form), they can be fused into kernels and use Tensor Cores; large dense manifold operators require materializing large intermediate tensors.
|
|
65
|
+
|
|
66
|
+
**Conclusions and reform strategies (echoing the toolbox in gpu-friendly-math.md)**:
|
|
67
|
+
|
|
68
|
+
1. **Prefer manifolds with closed-form retractions** (spheres, Stiefel-QR, SO(3), hyperbolic).
|
|
69
|
+
2. **Soften whenever possible**: replace hard constraints with pure-GEMM regularization terms (e.g., `lambda ||W^T W - I||^2` instead of strict orthogonal manifold) -- for most training this suffices.
|
|
70
|
+
3. **Small matrices / blocking**: restrict exp/Cayley/QR to small blocks or per-head, batched as batched GEMM.
|
|
71
|
+
4. **Structured Jacobians**: insist on triangular/coupling structures in normalizing flows, avoiding general LU for computing determinants.
|
|
72
|
+
5. **Precision guardrails**: for all matrix exp/log/eig, enforce fp32 accumulation and numerical stabilization (log-sum-exp style).
|
|
73
|
+
|
|
74
|
+
## Which Design Lens to Invoke
|
|
75
|
+
|
|
76
|
+
- **variational (primary)**: constrained optimization, Riemannian/manifold optimization, retraction selection.
|
|
77
|
+
- **symmetry**: Lie groups, equivariance, quotient manifolds, invariants under group actions.
|
|
78
|
+
- **duality**: coordinate chart transitions, pushforward/pullback, change of variables in normalizing flows, diffeomorphisms.
|
|
79
|
+
- **topological**: de Rham cohomology, global obstructions, "holes" and connectivity of latent spaces.
|
|
80
|
+
- **categorical**: extracting the "locally linear + smoothly patched" manifold skeleton from high-dimensional messy ambient data (the manifold hypothesis).
|
|
81
|
+
|
|
82
|
+
## Anti-patterns
|
|
83
|
+
|
|
84
|
+
- **Confusing ML "tensors" (arrays) with mathematical tensors (multilinear, with covariant/contravariant transformation laws)**, mistakenly assuming coordinate-independent invariance comes for free.
|
|
85
|
+
- **Putting exp / geodesics / matrix-log into bf16 hot training loops**: both slow (serial decomposition) and silently divergent. Ask first: "is there a closed-form retraction / can it be softened?"
|
|
86
|
+
- **Not softening when you should**: using strict manifold constraints for marginal gains while paying the throughput and stability cost of QR/eig; for many tasks, an orthogonality regularization term suffices.
|
|
87
|
+
- **Confusing gradients (covectors) with descent directions (vectors)**: forgetting the metric and treating raw autodiff output directly as natural gradients.
|
|
88
|
+
- **The illusion of a single global coordinate chart**: covering an entire manifold with one global parameterization inevitably introduces singularities (e.g., Euler angle gimbal lock); manifolds inherently require atlases / redundant parameterizations.
|
|
89
|
+
- **Manifold hypothesis overuse**: deploying the full Riemannian machinery when the parameter space is already flat Euclidean -- pure over-engineering (violates simplicity-first).
|
|
90
|
+
|
|
91
|
+
## Deep Dive Entry
|
|
92
|
+
|
|
93
|
+
> **Bibliographic info**: John M. Lee, *Introduction to Smooth Manifolds*, 2nd Edition, Graduate Texts in Mathematics 218, Springer, 2013. ISBN 978-1-4419-9981-8.
|
|
94
|
+
>
|
|
95
|
+
> **Activation method**: Place `Introduction to Smooth Manifolds.pdf` in the `math_book/` folder at the project root; the Agent can then automatically search the original text. The PDF is not distributed via npm/git (copyright reasons); obtain it independently.
|
|
96
|
+
|
|
97
|
+
> **Full-fidelity lookup**: when original definitions/theorems/proofs are needed, have the Agent **automatically search the local PDF** `math_book/Introduction to Smooth Manifolds.pdf` (locate by chapter number / keywords, do not rely on memory to restate). The following are actual chapter numbers (2nd ed.):
|
|
98
|
+
|
|
99
|
+
- **Ch 3 Tangent Vectors** -- tangent spaces, differentials/pushforwards, tangent bundles: local linearization and the geometric prototype of backpropagation.
|
|
100
|
+
- **Ch 11 The Cotangent Bundle** -- covector fields (1-forms), `df` as a covector, pullbacks: the true nature of gradients = covectors.
|
|
101
|
+
- **Ch 13 Riemannian Metrics** -- metrics, tangent-cotangent isomorphism (sharp/flat), distances: the root of natural gradients / Riemannian optimization.
|
|
102
|
+
- **Ch 9 Integral Curves and Flows** -- flows, integral curves, Lie derivatives/Lie brackets: Neural ODE / diffusion / structure-preserving dynamics.
|
|
103
|
+
- **Ch 20 The Exponential Map** -- the exponential map: the retraction prototype, and also the main bottleneck for GPU feasibility.
|
|
104
|
+
|
|
105
|
+
(Extensions: Ch 7 Lie Groups -> orthogonal/unitary constraints and equivariance; Ch 14 Differential Forms -> volume forms and log-det-Jacobian; Ch 22 Symplectic Manifolds -> symplectic integrators / HMC.)
|