math-skill 3.0.1 → 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.
Files changed (154) hide show
  1. package/README.en-US.md +42 -30
  2. package/README.md +18 -6
  3. package/agents/math-critic.en.md +6 -6
  4. package/agents/math-critic.md +6 -6
  5. package/commands/ask.en.md +6 -1
  6. package/commands/ask.md +6 -1
  7. package/design-patterns/attention/equivariant-attention.en.md +8 -2
  8. package/design-patterns/attention/equivariant-attention.md +7 -1
  9. package/design-patterns/attention/geometry-aware-attention.en.md +2 -2
  10. package/design-patterns/attention/geometry-aware-attention.md +1 -1
  11. package/design-patterns/attention/information-bottleneck-attention.en.md +32 -12
  12. package/design-patterns/attention/information-bottleneck-attention.md +32 -12
  13. package/design-patterns/attention/projection-attention.en.md +3 -3
  14. package/design-patterns/attention/projection-attention.md +2 -2
  15. package/design-patterns/attention/spectral-attention.en.md +19 -5
  16. package/design-patterns/attention/spectral-attention.md +18 -4
  17. package/design-patterns/compression/leverage-score-selection.en.md +13 -13
  18. package/design-patterns/compression/leverage-score-selection.md +13 -13
  19. package/design-patterns/compression/low-rank-kv-cache.en.md +39 -12
  20. package/design-patterns/compression/low-rank-kv-cache.md +38 -12
  21. package/design-patterns/compression/spectral-token-pruning.en.md +16 -14
  22. package/design-patterns/compression/spectral-token-pruning.md +16 -14
  23. package/design-patterns/compression/topology-preserving-compression.en.md +10 -10
  24. package/design-patterns/compression/topology-preserving-compression.md +10 -10
  25. package/design-patterns/loss/constraint-penalty.en.md +8 -4
  26. package/design-patterns/loss/constraint-penalty.md +9 -6
  27. package/design-patterns/loss/contrastive-loss.en.md +37 -11
  28. package/design-patterns/loss/contrastive-loss.md +38 -12
  29. package/design-patterns/loss/information-bottleneck-loss.en.md +5 -5
  30. package/design-patterns/loss/information-bottleneck-loss.md +6 -6
  31. package/design-patterns/loss/orthogonality-loss.en.md +24 -17
  32. package/design-patterns/loss/orthogonality-loss.md +24 -18
  33. package/design-patterns/loss/variational-loss.en.md +4 -4
  34. package/design-patterns/loss/variational-loss.md +5 -5
  35. package/design-patterns/overview.en.md +36 -0
  36. package/design-patterns/overview.md +36 -0
  37. package/design-patterns/representation/equivariant-split.en.md +4 -4
  38. package/design-patterns/representation/equivariant-split.md +4 -5
  39. package/design-patterns/representation/manifold-representation.en.md +12 -12
  40. package/design-patterns/representation/manifold-representation.md +13 -14
  41. package/design-patterns/representation/shared-private-decomposition.en.md +12 -7
  42. package/design-patterns/representation/shared-private-decomposition.md +12 -9
  43. package/design-patterns/representation/subspace-alignment.en.md +12 -12
  44. package/design-patterns/representation/subspace-alignment.md +12 -12
  45. package/design-patterns/routing/graph-routing.en.md +11 -11
  46. package/design-patterns/routing/graph-routing.md +11 -11
  47. package/design-patterns/routing/moe-routing.en.md +12 -12
  48. package/design-patterns/routing/moe-routing.md +12 -14
  49. package/design-patterns/routing/optimal-transport-routing.en.md +5 -5
  50. package/design-patterns/routing/optimal-transport-routing.md +6 -6
  51. package/design-patterns/routing/spectral-clustering-routing.en.md +26 -15
  52. package/design-patterns/routing/spectral-clustering-routing.md +26 -17
  53. package/knowledge-base/differential-geometry/connection.en.md +17 -2
  54. package/knowledge-base/differential-geometry/connection.md +17 -2
  55. package/knowledge-base/differential-geometry/curvature.en.md +14 -1
  56. package/knowledge-base/differential-geometry/curvature.md +14 -1
  57. package/knowledge-base/differential-geometry/geodesic.en.md +16 -2
  58. package/knowledge-base/differential-geometry/geodesic.md +16 -2
  59. package/knowledge-base/differential-geometry/index.en.md +52 -0
  60. package/knowledge-base/differential-geometry/index.md +52 -0
  61. package/knowledge-base/differential-geometry/manifold.en.md +15 -2
  62. package/knowledge-base/differential-geometry/manifold.md +15 -2
  63. package/knowledge-base/differential-geometry/metric-tensor.en.md +16 -2
  64. package/knowledge-base/differential-geometry/metric-tensor.md +16 -2
  65. package/knowledge-base/differential-geometry/tangent-space.en.md +17 -3
  66. package/knowledge-base/differential-geometry/tangent-space.md +17 -3
  67. package/knowledge-base/information-geometry/fisher-metric.en.md +24 -5
  68. package/knowledge-base/information-geometry/fisher-metric.md +24 -5
  69. package/knowledge-base/information-geometry/index.en.md +45 -0
  70. package/knowledge-base/information-geometry/index.md +45 -0
  71. package/knowledge-base/information-geometry/natural-gradient.en.md +17 -3
  72. package/knowledge-base/information-geometry/natural-gradient.md +17 -3
  73. package/knowledge-base/lie-theory/equivariance.en.md +18 -3
  74. package/knowledge-base/lie-theory/equivariance.md +18 -3
  75. package/knowledge-base/lie-theory/group-action.en.md +16 -2
  76. package/knowledge-base/lie-theory/group-action.md +16 -2
  77. package/knowledge-base/lie-theory/index.en.md +52 -0
  78. package/knowledge-base/lie-theory/index.md +52 -0
  79. package/knowledge-base/lie-theory/lie-algebra.en.md +17 -2
  80. package/knowledge-base/lie-theory/lie-algebra.md +17 -2
  81. package/knowledge-base/lie-theory/lie-group.en.md +17 -3
  82. package/knowledge-base/lie-theory/lie-group.md +17 -3
  83. package/knowledge-base/lie-theory/representation.en.md +17 -2
  84. package/knowledge-base/lie-theory/representation.md +17 -2
  85. package/knowledge-base/matrix-analysis/index.en.md +49 -0
  86. package/knowledge-base/matrix-analysis/index.md +49 -0
  87. package/knowledge-base/matrix-analysis/low-rank-approximation.en.md +20 -7
  88. package/knowledge-base/matrix-analysis/low-rank-approximation.md +20 -7
  89. package/knowledge-base/matrix-analysis/matrix-perturbation.en.md +13 -1
  90. package/knowledge-base/matrix-analysis/matrix-perturbation.md +13 -1
  91. package/knowledge-base/matrix-analysis/positive-semidefinite.en.md +20 -6
  92. package/knowledge-base/matrix-analysis/positive-semidefinite.md +20 -6
  93. package/knowledge-base/matrix-analysis/projection.en.md +14 -1
  94. package/knowledge-base/matrix-analysis/projection.md +14 -1
  95. package/knowledge-base/matrix-analysis/spectral-decomposition.en.md +14 -1
  96. package/knowledge-base/matrix-analysis/spectral-decomposition.md +14 -1
  97. package/knowledge-base/optimization/constrained-optimization.en.md +17 -3
  98. package/knowledge-base/optimization/constrained-optimization.md +17 -3
  99. package/knowledge-base/optimization/convex-optimization.en.md +15 -2
  100. package/knowledge-base/optimization/convex-optimization.md +15 -2
  101. package/knowledge-base/optimization/index.en.md +50 -0
  102. package/knowledge-base/optimization/index.md +50 -0
  103. package/knowledge-base/optimization/lagrangian-duality.en.md +18 -4
  104. package/knowledge-base/optimization/lagrangian-duality.md +18 -4
  105. package/knowledge-base/optimization/proximal-method.en.md +15 -1
  106. package/knowledge-base/optimization/proximal-method.md +15 -1
  107. package/knowledge-base/optimization/riemannian-optimization.en.md +18 -4
  108. package/knowledge-base/optimization/riemannian-optimization.md +18 -4
  109. package/knowledge-base/overview.en.md +20 -8
  110. package/knowledge-base/overview.md +20 -8
  111. package/knowledge-base/probability/concentration-inequality.en.md +16 -2
  112. package/knowledge-base/probability/concentration-inequality.md +16 -2
  113. package/knowledge-base/probability/entropy.en.md +19 -3
  114. package/knowledge-base/probability/entropy.md +18 -2
  115. package/knowledge-base/probability/fisher-information.en.md +17 -3
  116. package/knowledge-base/probability/fisher-information.md +17 -3
  117. package/knowledge-base/probability/index.en.md +51 -0
  118. package/knowledge-base/probability/index.md +51 -0
  119. package/knowledge-base/probability/information-bottleneck.en.md +18 -2
  120. package/knowledge-base/probability/information-bottleneck.md +18 -2
  121. package/knowledge-base/probability/kl-divergence.en.md +15 -2
  122. package/knowledge-base/probability/kl-divergence.md +15 -2
  123. package/knowledge-base/topology/euler-characteristic.en.md +15 -2
  124. package/knowledge-base/topology/euler-characteristic.md +15 -2
  125. package/knowledge-base/topology/fundamental-group.en.md +16 -2
  126. package/knowledge-base/topology/fundamental-group.md +16 -2
  127. package/knowledge-base/topology/index.en.md +48 -0
  128. package/knowledge-base/topology/index.md +48 -0
  129. package/knowledge-base/topology/persistent-homology.en.md +17 -2
  130. package/knowledge-base/topology/persistent-homology.md +17 -2
  131. package/lenses/spectral.en.md +1 -1
  132. package/lenses/spectral.md +1 -1
  133. package/lenses/topological.en.md +1 -1
  134. package/lenses/topological.md +1 -1
  135. package/package.json +5 -5
  136. package/references/agentic-workflow.en.md +2 -2
  137. package/references/books/abstract-algebra.en.md +12 -12
  138. package/references/books/abstract-algebra.md +9 -9
  139. package/references/books/algebraic-geometry-rising-sea.en.md +2 -2
  140. package/references/books/differential-geometry.en.md +16 -16
  141. package/references/books/differential-geometry.md +14 -14
  142. package/references/books/matrix-analysis.en.md +3 -3
  143. package/references/books/matrix-analysis.md +24 -24
  144. package/references/books/micro-lie-theory.en.md +1 -1
  145. package/references/books/optimization-ml.en.md +15 -15
  146. package/references/books/optimization-ml.md +14 -14
  147. package/references/books/smooth-manifolds.en.md +3 -3
  148. package/references/books/smooth-manifolds.md +6 -6
  149. package/references/gpu-friendly-math.en.md +21 -8
  150. package/references/gpu-friendly-math.md +19 -4
  151. package/references/skill-index.en.md +105 -0
  152. package/references/skill-index.md +105 -0
  153. package/skills/math-research-activator/SKILL.en.md +70 -112
  154. package/skills/math-research-activator/SKILL.md +60 -100
@@ -13,7 +13,7 @@ Minimizes an objective $f(x)$ over a constraint set $\mathcal{C} = \{x : g_i(x)
13
13
  - $\lambda_i g_i(x) = 0$ (complementary slackness)
14
14
  - Projected gradient method: $x_{k+1} = \text{proj}_{\mathcal{C}}(x_k - \alpha \nabla f(x_k))$
15
15
  - Penalty function method: $\min_x f(x) + \frac{\rho}{2}\sum [\max(0, g_i(x))]^2 + \frac{\rho}{2}\sum h_j(x)^2$
16
- - Augmented Lagrangian: $\mathcal{L}_\rho(x,\lambda) = f(x) + \sum \lambda_i g_i(x) + \frac{\rho}{2}\sum g_i(x)^2$
16
+ - Augmented Lagrangian (inequality constraints $g_i(x) \leq 0$): $\mathcal{L}_\rho(x,\lambda) = f(x) + \frac{\rho}{2}\sum_i \left[\max\!\left(0,\; \frac{\lambda_i}{\rho} + g_i(x)\right)^2 - \left(\frac{\lambda_i}{\rho}\right)^2\right]$ (strictly feasible constraints where $g_i(x) < 0$ and $\lambda_i/\rho + g_i(x) \leq 0$ are not penalized; for equality constraints this reduces to $\mathcal{L}_\rho = f(x) + \sum \nu_j h_j(x) + \frac{\rho}{2}\sum h_j(x)^2$)
17
17
  - Armijo line search (constrained version): $\alpha$ satisfies $f(\text{proj}_\mathcal{C}(x - \alpha \nabla f)) \leq f(x) - \sigma \alpha \|\nabla f\|^2$
18
18
 
19
19
  ## Applicable Problems
@@ -27,7 +27,7 @@ Minimizes an objective $f(x)$ over a constraint set $\mathcal{C} = \{x : g_i(x)
27
27
  ## AI Design Translation
28
28
 
29
29
  - **Weight clipping (WGAN)**: $W \leftarrow \text{clamp}(W, -c, c)$ is projection onto an $\ell_\infty$-box constraint. Implemented as `torch.clamp(W, -c, c)`, an elementwise operation with zero additional computation. Simple but coarse, less refined than spectral normalization.
30
- - **Spectral normalization**: Constrains $\sigma_{\max}(W) \leq 1$, i.e., projects onto the operator norm ball. Uses power iteration to estimate $u \leftarrow W^T W u / \|W^T W u\|$, then normalizes $W \leftarrow W / \sigma_{\max}$. Two matvec + norm operations per step; built into PyTorch as `torch.nn.utils.spectral_norm`.
30
+ - **Spectral normalization**: A common engineering way to enforce $\sigma_{\max}(W) \leq 1$ is the scaling reparameterization $W \leftarrow W / \max(1,\sigma_{\max})$, with $\sigma_{\max}$ estimated by power iteration. This is not the Frobenius-nearest projection onto the operator-norm ball; the exact projection clips singular values individually. About two matvec + norm operations per step; built into PyTorch as `torch.nn.utils.spectral_norm`.
31
31
  - **Projected gradient for $\ell_2$-ball constraints**: $\text{proj}(w) = w \cdot \min(1, R/\|w\|_2)$, implemented as `w * min(1, R / w.norm())`, one norm + elementwise operation, $O(d)$. Used in trust regions and adversarial robustness $\epsilon$-ball constraints.
32
32
  - **Augmented Lagrangian for RLHF/PPO**: $\mathcal{L} = -\mathbb{E}[r] + \lambda(\text{KL}(\pi\|\pi_{\text{ref}}) - \epsilon) + \frac{\rho}{2}(\text{KL} - \epsilon)^2$. The inner loop optimizes $\pi$ via PPO; the outer loop updates $\lambda \leftarrow \lambda + \rho(\text{KL} - \epsilon)$. KL computation involves softmax + elementwise log-ratio, GPU-friendly.
33
33
  - **Penalty method for sparsity/low-rank constraints**: $\mathcal{L}_{\text{penalty}} = \mathcal{L}_{\text{task}} + \rho \sum_i \max(0, \|w_i\|_1 - \tau)^2$ constrains per-layer sparsity to not exceed $\tau$. The penalty term is elementwise + reduce, differentiable and GPU-friendly. $\rho$ increasing schedule: $\rho \leftarrow \beta \rho$ ($\beta > 1$), doubling every several steps.
@@ -49,5 +49,19 @@ Minimizes an objective $f(x)$ over a constraint set $\mathcal{C} = \{x : g_i(x)
49
49
 
50
50
  ## Further References
51
51
 
52
- - Distilled notes: references/books/optimization-ml.md (Ch 20-21 Equality/Inequality Constraints and KKT, Ch 24 Constrained Algorithms Section 24.3 Projected Gradient, Section 24.5 Augmented Lagrangian, Section 24.6 Penalty Methods)
52
+ - Distilled notes: ../../references/books/optimization-ml.en.md (Ch 20-21 Equality/Inequality Constraints and KKT, Ch 24 Constrained Algorithms Section 24.3 Projected Gradient, Section 24.5 Augmented Lagrangian, Section 24.6 Penalty Methods)
53
53
  - Original text: Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 20-21 (Equality & Inequality Constraints) + Chapter 24 (Algorithms for Constrained Optimization Section 24.2-24.6)
54
+
55
+
56
+ ## Routing Extensions
57
+ - If a dual perspective is needed -> `lagrangian-duality.en.md` (Lagrangian duality theory)
58
+ - If constraints are on a manifold -> `riemannian-optimization.en.md` (Riemannian optimization for manifold constraints)
59
+ - If penalty term design is needed -> `constraint-penalty` (design pattern layer for constraint penalties)
60
+
61
+ ## Extensible Directions
62
+ - Penalty / barrier methods: converting constraints to penalty terms
63
+ - Sequential quadratic programming (SQP): second-order methods for constrained optimization
64
+ - Active set methods: identifying the active constraint set
65
+ - Constraint qualification: LICQ, MFCQ and other regularity conditions
66
+ - Exact penalty: exact solutions with finite penalty parameters
67
+ - Augmented Lagrangian methods: combining duality and penalty functions
@@ -13,7 +13,7 @@
13
13
  - $\lambda_i g_i(x) = 0$(互补松弛)
14
14
  - 投影梯度法:$x_{k+1} = \text{proj}_{\mathcal{C}}(x_k - \alpha \nabla f(x_k))$
15
15
  - 惩罚函数法:$\min_x f(x) + \frac{\rho}{2}\sum [\max(0, g_i(x))]^2 + \frac{\rho}{2}\sum h_j(x)^2$
16
- - 增广 Lagrangian:$\mathcal{L}_\rho(x,\lambda) = f(x) + \sum \lambda_i g_i(x) + \frac{\rho}{2}\sum g_i(x)^2$
16
+ - 增广 Lagrangian(不等式约束 $g_i(x) \leq 0$):$\mathcal{L}_\rho(x,\lambda) = f(x) + \frac{\rho}{2}\sum_i \left[\max\!\left(0,\; \frac{\lambda_i}{\rho} + g_i(x)\right)^2 - \left(\frac{\lambda_i}{\rho}\right)^2\right]$(严格可行约束 $g_i(x) < 0$ 且 $\lambda_i/\rho + g_i(x) \leq 0$ 时不受惩罚;等式约束退化为 $\mathcal{L}_\rho = f(x) + \sum \nu_j h_j(x) + \frac{\rho}{2}\sum h_j(x)^2$)
17
17
  - Armijo 线搜索(约束版):$\alpha$ 满足 $f(\text{proj}_\mathcal{C}(x - \alpha \nabla f)) \leq f(x) - \sigma \alpha \|\nabla f\|^2$
18
18
 
19
19
  ## 适用问题
@@ -27,7 +27,7 @@
27
27
  ## AI 设计翻译
28
28
 
29
29
  - **Weight Clipping (WGAN)**:$W \leftarrow \text{clamp}(W, -c, c)$ 即投影到 $\ell_\infty$-box 约束。实现为 `torch.clamp(W, -c, c)`,elementwise 操作,零额外计算。简单但粗糙,不如谱归一化精细。
30
- - **谱归一化 (Spectral Normalization)**:约束 $\sigma_{\max}(W) \leq 1$,即投影到算子范数球。用 power iteration 估 $u \leftarrow W^T W u / \|W^T W u\|$,归一化 $W \leftarrow W / \sigma_{\max}$。每步 2 次 matvec + norm,PyTorch 内置 `torch.nn.utils.spectral_norm`。
30
+ - **谱归一化 (Spectral Normalization)**:约束 $\sigma_{\max}(W) \leq 1$ 的常用工程做法是缩放重参数化 $W \leftarrow W / \max(1,\sigma_{\max})$,其中 $\sigma_{\max}$ 用 power iteration 估计。注意这不是 Frobenius 范数下到算子范数球的最近投影;真正最近投影需对奇异值逐个裁剪。每步约 2 次 matvec + norm,PyTorch 内置 `torch.nn.utils.spectral_norm`。
31
31
  - **投影梯度做 $\ell_2$-ball 约束**:$\text{proj}(w) = w \cdot \min(1, R/\|w\|_2)$,实现为 `w * min(1, R / w.norm())`,一次 norm + elementwise,$O(d)$。用于 trust region、对抗鲁棒的 $\epsilon$-ball 约束。
32
32
  - **增广 Lagrangian 做 RLHF/PPO**:$\mathcal{L} = -\mathbb{E}[r] + \lambda(\text{KL}(\pi\|\pi_{\text{ref}}) - \epsilon) + \frac{\rho}{2}(\text{KL} - \epsilon)^2$。内层对 $\pi$ 用 PPO 优化,外层 $\lambda \leftarrow \lambda + \rho(\text{KL} - \epsilon)$。KL 计算是 softmax + elementwise log-ratio,GPU 友好。
33
33
  - **惩罚法做稀疏/低秩约束**:$\mathcal{L}_{\text{penalty}} = \mathcal{L}_{\text{task}} + \rho \sum_i \max(0, \|w_i\|_1 - \tau)^2$ 约束每层稀疏度不超 $\tau$。惩罚项是 elementwise + reduce,可微且 GPU 友好。$\rho$ 递增策略:$\rho \leftarrow \beta \rho$($\beta > 1$),每若干步加倍。
@@ -49,5 +49,19 @@
49
49
 
50
50
  ## 深入参考
51
51
 
52
- - 蒸馏稿:references/books/optimization-ml.md(Ch 20-21 等式/不等式约束与 KKT、Ch 24 约束算法 §24.3 投影梯度 §24.5 增广 Lagrange §24.6 惩罚法)
52
+ - 蒸馏稿:../../references/books/optimization-ml.md(Ch 20-21 等式/不等式约束与 KKT、Ch 24 约束算法 §24.3 投影梯度 §24.5 增广 Lagrange §24.6 惩罚法)
53
53
  - 原书:Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 20-21 (Equality & Inequality Constraints) + Chapter 24 (Algorithms for Constrained Optimization §24.2-24.6)
54
+
55
+
56
+ ## 路由扩展
57
+ - 若需要从对偶视角分析 → `lagrangian-duality.md`(Lagrange 对偶理论)
58
+ - 若约束在流形上 → `riemannian-optimization.md`(流形约束的黎曼优化)
59
+ - 若需要惩罚项设计 → `constraint-penalty`(设计模式层的约束惩罚)
60
+
61
+ ## 可扩展方向
62
+ - 罚函数/障碍函数(penalty / barrier methods):将约束转化为惩罚项
63
+ - 序列二次规划(SQP):约束优化的二阶方法
64
+ - 有效集方法(active set methods):识别活跃约束集
65
+ - 约束规范(constraint qualification):LICQ, MFCQ 等正则条件
66
+ - 精确罚函数(exact penalty):有限罚参数下的精确解
67
+ - 增广 Lagrangian 方法(augmented Lagrangian methods):结合对偶与罚函数
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Minimal Definition
4
4
 
5
- Optimization problems that minimize a convex function over a convex set. Convexity guarantees that a local optimum is also a global optimum, and the first-order condition ($\nabla f = 0$) is both necessary and sufficient. Convex problems are the only class in optimization theory that guarantees global optimality with efficient solvability.
5
+ Optimization problems that minimize a convex function over a convex set. Convexity guarantees that a local optimum is also a global optimum. For **unconstrained, differentiable** convex optimization, the first-order condition ($\nabla f(x^*) = 0$) is both necessary and sufficient; for **constrained** convex optimization ($\min f(x)$ s.t. $x \in C$), the KKT conditions are necessary and sufficient under Slater's condition; for **non-smooth** convex optimization, the optimality condition is $0 \in \partial f(x^*) + N_C(x^*)$, where $N_C$ is the normal cone of the constraint set. Convex problems are the only class in optimization theory that guarantees global optimality with efficient solvability.
6
6
 
7
7
  ## Core Formulas
8
8
 
@@ -46,5 +46,18 @@ Optimization problems that minimize a convex function over a convex set. Convexi
46
46
 
47
47
  ## Further References
48
48
 
49
- - Distilled notes: references/books/optimization-ml.md (Ch 22 Convex Optimization, Section 22.2 Convex Functions, Section 22.3 Convex Problems, Section 22.4 SDP/LMI)
49
+ - Distilled notes: ../../references/books/optimization-ml.en.md (Ch 22 Convex Optimization, Section 22.2 Convex Functions, Section 22.3 Convex Problems, Section 22.4 SDP/LMI)
50
50
  - Original text: Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 22 (Convex Optimization Problems Section 22.1-22.4)
51
+
52
+
53
+ ## Routing Extensions
54
+ - If the problem has constraints -> `constrained-optimization.en.md` (constrained convex optimization methods)
55
+ - If the objective is non-smooth -> `proximal-method.en.md` (proximal methods for non-smooth parts)
56
+
57
+ ## Extensible Directions
58
+ - Self-concordant functions: convergence guarantees for Newton's method
59
+ - Interior point methods: polynomial-time methods for large-scale convex optimization
60
+ - First-order method convergence rates: optimal convergence rates for gradient descent
61
+ - Accelerated methods (Nesterov acceleration): Nesterov momentum and optimal first-order methods
62
+ - Online convex optimization: regret analysis for sequential decision-making
63
+ - Bandit convex optimization: convex optimization with zeroth-order information
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 最小定义
4
4
 
5
- 在凸集上最小化凸函数的优化问题。凸性保证局部最优即全局最优,且一阶条件($\nabla f = 0$)是充分必要的。凸问题是优化理论中唯一能保证全局最优且可高效求解的类别。
5
+ 在凸集上最小化凸函数的优化问题。凸性保证局部最优即全局最优。对于**无约束可微**凸优化,一阶条件($\nabla f(x^*) = 0$)是充分必要的;对于**约束**凸优化($\min f(x)$ s.t. $x \in C$),KKT 条件在 Slater 条件满足时是充分必要的;对于**非光滑**凸优化,最优性条件为 $0 \in \partial f(x^*) + N_C(x^*)$,其中 $N_C$ 为约束集的法锥。凸问题是优化理论中唯一能保证全局最优且可高效求解的类别。
6
6
 
7
7
  ## 核心公式
8
8
 
@@ -46,5 +46,18 @@
46
46
 
47
47
  ## 深入参考
48
48
 
49
- - 蒸馏稿:references/books/optimization-ml.md(Ch 22 Convex Optimization、§22.2 凸函数、§22.3 凸问题、§22.4 SDP/LMI)
49
+ - 蒸馏稿:../../references/books/optimization-ml.md(Ch 22 Convex Optimization、§22.2 凸函数、§22.3 凸问题、§22.4 SDP/LMI)
50
50
  - 原书:Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 22 (Convex Optimization Problems §22.1-22.4)
51
+
52
+
53
+ ## 路由扩展
54
+ - 若问题有约束 → `constrained-optimization.md`(约束凸优化方法)
55
+ - 若目标不可微 → `proximal-method.md`(近端方法处理非光滑部分)
56
+
57
+ ## 可扩展方向
58
+ - 自协调函数(self-concordant functions):Newton 法的收敛保证
59
+ - 内点法(interior point methods):大规模凸优化的多项式时间方法
60
+ - 一阶方法收敛率(first-order convergence rates):梯度下降的最优收敛速率
61
+ - 加速方法(Nesterov acceleration):Nesterov 动量加速与最优一阶方法
62
+ - 在线凸优化(online convex optimization):序列决策的 regret 分析
63
+ - Bandit 凸优化(bandit convex optimization):零阶信息下的凸优化
@@ -0,0 +1,50 @@
1
+ # Optimization Activation Index
2
+
3
+ ## Domain Signals
4
+ Activate this domain direction when the problem involves:
5
+ - Constrained optimization: objective function must satisfy equality or inequality constraints
6
+ - Duality gap: need to analyze the relationship between primal and dual problems
7
+ - Saddle point problems: min-max optimization or game-theoretic structure
8
+ - Non-convex landscape: geometric structure analysis of loss functions
9
+ - Manifold constraints: parameters need to be optimized on a manifold
10
+ - Splitting operators: objective decomposes into multiple components for combined optimization
11
+
12
+ ## Core Anchors
13
+ - `lagrangian-duality.en.md` — Lagrangian duality theory
14
+ - `convex-optimization.en.md` — Convex optimization fundamentals
15
+ - `constrained-optimization.en.md` — Constrained optimization methods
16
+ - `riemannian-optimization.en.md` — Riemannian optimization
17
+ - `proximal-method.en.md` — Proximal methods
18
+
19
+ ## Extended Concepts
20
+ When core anchors are insufficient, the following concepts may need temporary activation:
21
+ - ADMM: alternating direction method of multipliers, suitable for splitting structures
22
+ - mirror descent: mirror descent, suitable for non-Euclidean geometry
23
+ - Frank-Wolfe: conditional gradient method, suitable for sparsity constraints
24
+ - stochastic optimization (SGD / SAdam convergence): convergence theory for stochastic optimization
25
+ - second-order methods (Newton / quasi-Newton): second-order and quasi-Newton methods
26
+ - trust region: trust region methods
27
+ - line search: line search strategies and convergence guarantees
28
+ - gradient clipping theory: theoretical analysis of gradient clipping
29
+ - sharpness-aware minimization (SAM): sharpness-aware minimization
30
+ - neural tangent kernel optimization landscape: optimization landscape under NTK
31
+ - implicit regularization: implicit regularization effects
32
+ - bilevel optimization: bilevel optimization and hyperparameter optimization
33
+ - minimax optimization: minimax optimization theory
34
+ - meta-learning optimization: optimization framework for meta-learning
35
+
36
+ ## Reference Book Directions
37
+ - `../../references/books/optimization-ml.en.md`: comprehensive coverage of ML optimization, including convex optimization, stochastic methods, and second-order methods
38
+
39
+ ## AI Translation Directions
40
+ - lagrangian duality → primal-dual training / adversarial loss / constrained generation
41
+ - convex optimization → convex regularizers / proximal updates / mirror descent optimizer
42
+ - constrained optimization → projected gradient / penalty loss / barrier methods in training
43
+ - riemannian optimization → manifold-constrained parameters / natural gradient / geodesic update
44
+ - proximal method → sparse regularization / ISTA/FISTA layers / proximal neural networks
45
+
46
+ ## Temporary Activation Rules
47
+ When the problem requires mathematics not in the core anchors:
48
+ 1. First check whether extended concepts contain a match
49
+ 2. If yes, generate a temporary knowledge card based on the lens
50
+ 3. If no, enter the Knowledge Gap Protocol
@@ -0,0 +1,50 @@
1
+ # 最优化 激活索引 / Optimization Activation Index
2
+
3
+ ## 领域信号
4
+ 当问题涉及以下信号时,激活本领域方向:
5
+ - 约束优化:目标函数需要满足等式或不等式约束
6
+ - 对偶间隙:需要分析原始问题与对偶问题的关系
7
+ - 鞍点问题:min-max 优化或博弈论结构
8
+ - 非凸 landscape:损失函数的几何结构分析
9
+ - 流形约束:参数需要在流形上优化
10
+ - 分裂算子:目标函数可分解为多个部分的组合优化
11
+
12
+ ## 核心锚点
13
+ - `lagrangian-duality.md` — Lagrange 对偶理论
14
+ - `convex-optimization.md` — 凸优化基础
15
+ - `constrained-optimization.md` — 约束优化方法
16
+ - `riemannian-optimization.md` — 黎曼优化
17
+ - `proximal-method.md` — 近端方法
18
+
19
+ ## 扩展概念
20
+ 当核心锚点不够时,以下概念可能需要临时激活:
21
+ - ADMM:交替方向乘子法,适用于分裂结构
22
+ - mirror descent:镜像下降,适用于非欧几何
23
+ - Frank-Wolfe:条件梯度法,适用于稀疏约束
24
+ - stochastic optimization(SGD / SAdam convergence):随机优化的收敛理论
25
+ - second-order methods(Newton / quasi-Newton):二阶与拟牛顿方法
26
+ - trust region:信赖域方法
27
+ - line search:线搜索策略与收敛保证
28
+ - gradient clipping theory:梯度裁剪的理论分析
29
+ - sharpness-aware minimization (SAM):尖锐度感知最小化
30
+ - neural tangent kernel optimization landscape:NTK 下的优化景观
31
+ - implicit regularization:隐式正则化效应
32
+ - bilevel optimization:双层优化与超参数优化
33
+ - minimax optimization:极小极大优化理论
34
+ - meta-learning optimization:元学习的优化框架
35
+
36
+ ## 参考书方向
37
+ - `../../references/books/optimization-ml.md`:机器学习优化的全面覆盖,包括凸优化、随机方法和二阶方法
38
+
39
+ ## AI 翻译方向
40
+ - lagrangian duality → primal-dual training / adversarial loss / constrained generation
41
+ - convex optimization → convex regularizers / proximal updates / mirror descent optimizer
42
+ - constrained optimization → projected gradient / penalty loss / barrier methods in training
43
+ - riemannian optimization → manifold-constrained parameters / natural gradient / geodesic update
44
+ - proximal method → sparse regularization / ISTA/FISTA layers / proximal neural networks
45
+
46
+ ## 临时激活规则
47
+ 当问题需要的数学不在核心锚点中时:
48
+ 1. 先检查扩展概念中是否有匹配
49
+ 2. 若有,根据透镜生成临时知识卡
50
+ 3. 若无,进入 Knowledge Gap Protocol
@@ -24,9 +24,9 @@ Transforms a constrained optimization problem (primal) into a maximization probl
24
24
 
25
25
  ## AI Design Translation
26
26
 
27
- - **Minimax framework for adversarial training**: $L(\theta, \phi) = \mathbb{E}[\log D_\phi(x)] + \mathbb{E}[\log(1 - D_\phi(G_\theta(z)))]$. $G$ and $D$ alternate between gradient ascent and descent; the core operations are forward + backward passes (matmul chains). Gradient penalty / spectral norm constrains the Lipschitz constant of $D$ to ensure the existence of a saddle point.
27
+ - **Minimax framework for adversarial training**: $L(\theta, \phi) = \mathbb{E}[\log D_\phi(x)] + \mathbb{E}[\log(1 - D_\phi(G_\theta(z)))]$. $G$ and $D$ alternate between gradient ascent and descent; the core operations are forward + backward passes (matmul chains). Gradient penalty / spectral norm can control the Lipschitz constant of $D$ and improve training stability, but it does not guarantee that a non-convex minimax problem has, or converges to, a benign saddle point.
28
28
  - **SVM dual + kernel trick**: Primal $\min_w \frac{1}{2}\|w\|^2 + C\sum\xi_i$ converted to dual $\max_\alpha \sum\alpha_i - \frac{1}{2}\alpha^T(K \circ yy^T)\alpha$. The kernel Gram matrix $K_{ij} = k(x_i, x_j)$ is computed via matmul (linear kernel) or elementwise operations (RBF kernel). Dual variables $\alpha \in \mathbb{R}^n$ are solved using SMO or gradient projection.
29
- - **Augmented Lagrangian constrained training**: $\mathcal{L}_{\text{AL}} = f(x) + \sum \lambda_i g_i(x) + \frac{\rho}{2}\sum g_i(x)^2$. The inner loop optimizes $x$ via SGD; the outer loop updates $\lambda$ via gradient ascent: $\lambda \leftarrow [\lambda + \rho g(x)]_+$. The $\rho$ term ensures inner-loop convexity, enabling convergence even for non-convex original problems.
29
+ - **Augmented Lagrangian constrained training**: $\mathcal{L}_{\text{AL}} = f(x) + \sum \lambda_i g_i(x) + \frac{\rho}{2}\sum g_i(x)^2$. The inner loop optimizes $x$ via SGD; the outer loop updates $\lambda$ via gradient ascent: $\lambda \leftarrow [\lambda + \rho g(x)]_+$. The $\rho$ term improves the concavity of the dual function (making the dual problem easier to solve), but does NOT guarantee global convergence for non-convex original problems. Convergence depends on: (a) constraint qualifications (e.g., LICQ/MFCQ), (b) second-order sufficient conditions, (c) $\rho$ being large enough to satisfy local convexity conditions.
30
30
  - **Dual decomposition**: $\min \sum_k f_k(x_k)$ s.t. $\sum x_k \leq b$ decomposes into independent subproblems $\min_{x_k} f_k(x_k) + \lambda^T x_k$, with the master problem $\max_\lambda g(\lambda)$ solved via subgradient ascent. Naturally parallelizable, suitable for distributed training.
31
31
  - **Dual perspective on the information bottleneck**: $\min I(Z;X) - \beta I(Z;Y)$ can be formulated as constrained optimization, where $\beta$ is the dual variable. The variational IB relaxes this via the ELBO, reducing to standard VAE training (reparameterization trick + SGD).
32
32
 
@@ -39,12 +39,26 @@ Transforms a constrained optimization problem (primal) into a maximization probl
39
39
 
40
40
  ## Risks and Failure Conditions
41
41
 
42
- - **Duality gap for non-convex problems**: Strong duality is only guaranteed for convex problems + Slater's condition. In non-convex neural network training, $d^* < p^*$ is common, and the dual solution does not yield a primal-feasible solution. Solution: augmented Lagrangian (eliminates the gap when $\rho$ is sufficiently large) or SQP.
42
+ - **Duality gap for non-convex problems**: Strong duality is only guaranteed for convex problems + Slater's condition. In non-convex neural network training, $d^* < p^*$ is common, and the dual solution does not yield a primal-feasible solution. Solution: for convex problems, augmented Lagrangian (with the exact penalty property when $\rho$ is sufficiently large, which can eliminate the duality gap); for non-convex problems, the duality gap may persist regardless of $\rho$, and the augmented Lagrangian only guarantees local convergence to KKT points -- alternatively, use SQP.
43
43
  - **Dual variable oscillation**: Improper step sizes for gradient ascent on $\lambda$ can cause dual variable oscillation and primal infeasibility. Solution: use adaptive step sizes (Adam updates for $\lambda$) or an increasing $\rho$ schedule in the augmented Lagrangian.
44
44
  - **Numerical determination of complementary slackness**: $\lambda_i g_i(x) = 0$ can only be satisfied to $\sim 10^{-6}$ in floating point; strict complementary slackness is unattainable. This affects SVM support vector identification; a threshold must be set.
45
45
  - **Mode collapse in minimax training**: The non-convex-non-concave game in GAN $\min\max$ leads to mode collapse or training instability. Additional regularization such as gradient penalty (WGAN-GP) or spectral normalization is required.
46
46
 
47
47
  ## Further References
48
48
 
49
- - Distilled notes: references/books/optimization-ml.md (Ch 23 Lagrangian Duality, Section 23.5 Strong Duality, Section 23.6.3 Slater's Condition)
49
+ - Distilled notes: ../../references/books/optimization-ml.en.md (Ch 23 Lagrangian Duality, Section 23.5 Strong Duality, Section 23.6.3 Slater's Condition)
50
50
  - Original text: Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 23 (Lagrangian Duality Section 23.1-23.6) + Chapter 17 (LP Duality)
51
+
52
+
53
+ ## Routing Extensions
54
+ - If starting from the primal problem -> `constrained-optimization.en.md` (primal constrained optimization)
55
+ - If strong duality conditions are needed -> `convex-optimization.en.md` (strong duality theorem for convex problems)
56
+ - If the dual form of IB objective is involved -> `../probability/information-bottleneck.md` (variational dual of information bottleneck)
57
+
58
+ ## Extensible Directions
59
+ - Augmented Lagrangian: penalty-enhanced Lagrangian methods
60
+ - Saddle point theory: existence and computation of Lagrangian saddle points
61
+ - KKT condition regularity: constraint qualifications and KKT necessary conditions
62
+ - Conic duality: duality theory for conic programming
63
+ - Fenchel duality: convex conjugates and Fenchel-Rockafellar duality
64
+ - Minimax duality: min-max theorems and duality gaps
@@ -24,9 +24,9 @@
24
24
 
25
25
  ## AI 设计翻译
26
26
 
27
- - **对抗训练的 minimax 框架**:$L(\theta, \phi) = \mathbb{E}[\log D_\phi(x)] + \mathbb{E}[\log(1 - D_\phi(G_\theta(z)))]$。$G$ 和 $D$ 交替梯度上升/下降,核心操作是前向 + 反向传播(matmul 链)。梯度惩罚 / spectral norm 约束 $D$ 的 Lipschitz 保证 minimax 有鞍点。
27
+ - **对抗训练的 minimax 框架**:$L(\theta, \phi) = \mathbb{E}[\log D_\phi(x)] + \mathbb{E}[\log(1 - D_\phi(G_\theta(z)))]$。$G$ 和 $D$ 交替梯度上升/下降,核心操作是前向 + 反向传播(matmul 链)。梯度惩罚 / spectral norm 可控制 $D$ 的 Lipschitz 常数并改善训练稳定性,但不保证非凸 minimax 一定存在或收敛到良性鞍点。
28
28
  - **SVM 对偶 + 核技巧**:原始 $\min_w \frac{1}{2}\|w\|^2 + C\sum\xi_i$ 转对偶 $\max_\alpha \sum\alpha_i - \frac{1}{2}\alpha^T(K \circ yy^T)\alpha$。核 Gram $K_{ij} = k(x_i, x_j)$ 是 matmul(线性核)或 elementwise(RBF 核)。对偶变量 $\alpha \in \mathbb{R}^n$,用 SMO 或梯度投影求解。
29
- - **增广 Lagrangian 约束训练**:$\mathcal{L}_{\text{AL}} = f(x) + \sum \lambda_i g_i(x) + \frac{\rho}{2}\sum g_i(x)^2$。内层对 $x$ 用 SGD 优化,外层对 $\lambda$ 梯度上升更新:$\lambda \leftarrow [\lambda + \rho g(x)]_+$。$\rho$ 项保证内层凸性,即使原问题非凸也收敛。
29
+ - **增广 Lagrangian 约束训练**:$\mathcal{L}_{\text{AL}} = f(x) + \sum \lambda_i g_i(x) + \frac{\rho}{2}\sum g_i(x)^2$。内层对 $x$ 用 SGD 优化,外层对 $\lambda$ 梯度上升更新:$\lambda \leftarrow [\lambda + \rho g(x)]_+$。$\rho$ 项改善对偶函数的凹性(使对偶问题更容易求解),但对非凸原问题不保证全局收敛。收敛性依赖于:(a) 约束规格(如 LICQ/MFCQ),(b) 二阶充分条件,(c) $\rho$ 足够大以满足局部凸性条件。
30
30
  - **对偶分解 (Dual Decomposition)**:$\min \sum_k f_k(x_k)$ s.t. $\sum x_k \leq b$ 分解为各子问题 $\min_{x_k} f_k(x_k) + \lambda^T x_k$ 独立求解,主问题 $\max_\lambda g(\lambda)$ 用次梯度上升。天然可并行,适合分布式训练。
31
31
  - **信息瓶颈的对偶视角**:$\min I(Z;X) - \beta I(Z;Y)$ 可写为带约束优化,$\beta$ 是对偶变量。Variational IB 用 ELBO 松弛后变成标准 VAE 训练(reparameterization trick + SGD)。
32
32
 
@@ -39,12 +39,26 @@
39
39
 
40
40
  ## 风险与失效条件
41
41
 
42
- - **非凸问题的对偶间隙**:强对偶仅对凸问题 + Slater 条件保证。非凸神经网络训练中 $d^* < p^*$ 常见,对偶解不给出原始可行解。解决:增广 Lagrangian($\rho$ 足够大时消除间隙)或 SQP。
42
+ - **非凸问题的对偶间隙**:强对偶仅对凸问题 + Slater 条件保证。非凸神经网络训练中 $d^* < p^*$ 常见,对偶解不给出原始可行解。解决:对凸问题,增广 Lagrangian($\rho$ 足够大时具有 exact penalty 性质,可消除对偶间隙);对非凸问题,对偶间隙可能持续存在,增广 Lagrangian 只能保证局部收敛到 KKT 点,或改用 SQP。
43
43
  - **对偶变量振荡**:$\lambda$ 的梯度上升步长不当会导致对偶变量振荡、原始不可行。解决:使用自适应步长(Adam 更新 $\lambda$)或增广 Lagrangian 的 $\rho$ 递增策略。
44
44
  - **互补松弛的数值判定**:$\lambda_i g_i(x) = 0$ 在浮点下只能达到 $\sim 10^{-6}$,严格互补松弛不可得。影响 SVM 支持向量识别等,需设阈值。
45
45
  - **Minimax 训练的 mode collapse**:GAN 中 $\min\max$ 的非凸-非凹博弈导致模式坍缩或训练不稳定。需梯度惩罚(WGAN-GP)、谱归一化等额外正则化。
46
46
 
47
47
  ## 深入参考
48
48
 
49
- - 蒸馏稿:references/books/optimization-ml.md(Ch 23 Lagrangian Duality、§23.5 强对偶、§23.6.3 Slater 条件)
49
+ - 蒸馏稿:../../references/books/optimization-ml.md(Ch 23 Lagrangian Duality、§23.5 强对偶、§23.6.3 Slater 条件)
50
50
  - 原书:Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 23 (Lagrangian Duality §23.1-23.6) + Chapter 17 (LP Duality)
51
+
52
+
53
+ ## 路由扩展
54
+ - 若需要从原始问题出发 → `constrained-optimization.md`(原始约束优化)
55
+ - 若需要强对偶条件 → `convex-optimization.md`(凸问题的强对偶定理)
56
+ - 若涉及 IB 目标函数的对偶形式 → `../probability/information-bottleneck.md`(信息瓶颈的变分对偶)
57
+
58
+ ## 可扩展方向
59
+ - 增广 Lagrangian(augmented Lagrangian):罚项增强的 Lagrangian 方法
60
+ - 鞍点理论(saddle point theory):Lagrangian 鞍点的存在性与求解
61
+ - KKT 条件正则性(KKT regularity):约束规范与 KKT 必要条件
62
+ - 锥对偶(conic duality):锥规划的对偶理论
63
+ - Fenchel 对偶(Fenchel duality):凸共轭与 Fenchel-Rockafellar 对偶
64
+ - 极小极大对偶(minimax duality):min-max 定理与对偶间隙
@@ -48,5 +48,19 @@ For non-smooth or non-differentiable objective functions $f(x) = g(x) + h(x)$ ($
48
48
 
49
49
  ## Further References
50
50
 
51
- - Distilled notes: references/books/optimization-ml.md (Ch 8 Gradient Methods Section 8.3 Convergence Analysis, Ch 11 Quasi-Newton Section 11.5 BFGS, Ch 24 Constrained Algorithms Section 24.5 Augmented Lagrangian)
51
+ - Distilled notes: ../../references/books/optimization-ml.en.md (Ch 8 Gradient Methods Section 8.3 Convergence Analysis, Ch 11 Quasi-Newton Section 11.5 BFGS, Ch 24 Constrained Algorithms Section 24.5 Augmented Lagrangian)
52
52
  - Original text: Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 24 (Constrained Algorithms Section 24.5 Augmented Lagrangian) + Parikh & Boyd, *Proximal Algorithms*, Foundations and Trends in Optimization, 2014
53
+
54
+
55
+ ## Routing Extensions
56
+ - If the smooth part dominates -> `convex-optimization.en.md` (convex optimization for smooth parts)
57
+ - If the proximal operator corresponds to a constraint -> `constrained-optimization.en.md` (equivalence of indicator functions and constraints)
58
+ - If used for variational loss regularization -> `variational-loss` (design pattern layer for proximal regularization)
59
+
60
+ ## Extensible Directions
61
+ - Proximal gradient (ISTA / FISTA): fast proximal methods for L1 regularization
62
+ - Douglas-Rachford splitting: optimizing sums of two non-smooth functions
63
+ - Primal-dual hybrid gradient (PDHG): first-order methods for saddle point problems
64
+ - Alternating minimization: block-wise optimization for block-separable objectives
65
+ - Block coordinate descent: block update strategies for high-dimensional problems
66
+ - Proximal neural networks: embedding proximal operators into network architecture
@@ -48,5 +48,19 @@
48
48
 
49
49
  ## 深入参考
50
50
 
51
- - 蒸馏稿:references/books/optimization-ml.md(Ch 8 梯度法 §8.3 收敛分析、Ch 11 拟牛顿 §11.5 BFGS、Ch 24 约束算法 §24.5 增广 Lagrange)
51
+ - 蒸馏稿:../../references/books/optimization-ml.md(Ch 8 梯度法 §8.3 收敛分析、Ch 11 拟牛顿 §11.5 BFGS、Ch 24 约束算法 §24.5 增广 Lagrange)
52
52
  - 原书:Chong, Lu, Zak, *An Introduction to Optimization* 5th Ed., Chapter 24 (Constrained Algorithms §24.5 Augmented Lagrangian) + Parikh & Boyd, *Proximal Algorithms*, Foundations and Trends in Optimization, 2014
53
+
54
+
55
+ ## 路由扩展
56
+ - 若可微部分主导 → `convex-optimization.md`(光滑部分的凸优化方法)
57
+ - 若近端算子对应约束 → `constrained-optimization.md`(指示函数与约束的等价)
58
+ - 若用于变分损失的正则化 → `variational-loss`(设计模式层的近端正则化)
59
+
60
+ ## 可扩展方向
61
+ - 近端梯度(ISTA / FISTA):L1 正则化的快速近端方法
62
+ - Douglas-Rachford 分裂:两个非光滑函数之和的优化
63
+ - 原始-对偶混合梯度(PDHG):鞍点问题的一阶方法
64
+ - 交替最小化(alternating minimization):块可分目标的分块优化
65
+ - 块坐标下降(block coordinate descent):高维问题的分块更新策略
66
+ - 近端神经网络(proximal neural networks):将近端算子嵌入网络结构
@@ -9,10 +9,11 @@ Optimization on smooth manifolds $\mathcal{M}$ (e.g., the orthogonal group $O(n)
9
9
  - Riemannian gradient: $\text{grad} f(x) = \text{proj}_{T_x\mathcal{M}}(\nabla f(x))$ (Euclidean gradient projected onto the tangent space)
10
10
  - Riemannian gradient descent: $x_{k+1} = R_{x_k}(-\alpha_k \cdot \text{grad} f(x_k))$, where $R$ is a retraction
11
11
  - Tangent space of the orthogonal group $O(n)$: $T_Q O(n) = \{Q\Omega : \Omega^T = -\Omega\}$ (left multiplication by skew-symmetric matrices)
12
- - Cayley retraction for the orthogonal group: $R_Q(\xi) = Q(I + \frac{1}{2}\Omega)^{-1}(I - \frac{1}{2}\Omega)$, $\xi = Q\Omega$
12
+ - Cayley retraction for the orthogonal group: $R_Q(\xi) = Q(I + \frac{1}{2}\Omega)^{-1}(I - \frac{1}{2}\Omega)$, $\xi = Q\Omega$; equivalently in $A$-form: let $G = \nabla f(Q)$ be the Euclidean gradient and $A = GQ^T - QG^T$ (skew-symmetric), then $R_Q(t) = (I + \frac{t}{2}A)^{-1}(I - \frac{t}{2}A)Q$, with step size $t > 0$ moving along the negative gradient (descent direction)
13
13
  - Polar decomposition retraction: $R_Q(\xi) = (Q + \xi)(I + \xi^T\xi)^{-1/2}$ (projection onto the nearest orthogonal matrix)
14
14
  - Newton-Schulz orthogonalization: $X_{k+1} = \frac{1}{2}X_k(3I - X_k^T X_k)$, converging to the nearest orthogonal matrix
15
15
  - Hyperbolic space (Poincaré ball): $\text{grad}_{\mathcal{H}} f = \frac{(1-\|x\|^2)^2}{4} \nabla f(x)$
16
+ - Riemannian gradient on the Stiefel manifold $St(n,p) = \{W : W^TW = I_p\}$: $\text{grad} f(W) = G - W \cdot \text{sym}(W^TG)$, where $G = \nabla f(W)$ is the Euclidean gradient and $\text{sym}(A) = \frac{A + A^T}{2}$ is the symmetric correction term. Note: one cannot simply use $G - WW^TG$ (orthogonal projection); the symmetric correction is essential to ensure the gradient lies in the tangent space.
16
17
 
17
18
  ## Applicable Problems
18
19
 
@@ -24,8 +25,8 @@ Optimization on smooth manifolds $\mathcal{M}$ (e.g., the orthogonal group $O(n)
24
25
 
25
26
  ## AI Design Translation
26
27
 
27
- - **Muon optimizer (orthogonalized gradient updates)**: Projects the momentum matrix $M$ onto the nearest orthogonal matrix via Newton-Schulz iteration: $X_{k+1} = \frac{1}{2}X_k(3I - X_k^TX_k)$, converging in 5 steps. Update $W \leftarrow W - \alpha \cdot U$ ($U$ being the orthogonalized result). The core is a pure matmul chain, 2 matmul operations per step, fully tensor-core-friendly, stable under bf16.
28
- - **Manifold perspective on spectral normalization**: The constraint $\sigma_{\max}(W) = 1$ is equivalent to projection onto a tangent direction of the Stiefel manifold. Power iteration for direction estimation + normalization = an approximate Riemannian gradient projection. Implementation is identical to standard spectral norm.
28
+ - **Muon optimizer (orthogonalized gradient updates)**: Approximates the orthogonal polar factor of a scaled momentum matrix $M$ via Newton-Schulz / polar iteration, e.g. $X_{k+1} = \frac{1}{2}X_k(3I - X_k^TX_k)$ (after normalization and under spectral conditions). A fixed 5-step iteration is an engineering approximation, not an unconditional convergence guarantee. Update $W \leftarrow W - \alpha \cdot U$ ($U$ being the orthogonalized result). The core is a matmul chain, tensor-core-friendly, with scaling and residual checks needed in low precision.
29
+ - **Manifold perspective on spectral normalization**: The common constraint $\sigma_{\max}(W) \leq 1$ is enforced by scaling weights by the largest singular value, i.e. a reparameterization / normalization. It is not a Stiefel tangent projection and not the exact nearest projection onto the spectral-norm ball. Power iteration only estimates the top singular direction.
29
30
  - **Orthogonal RNN**: Hidden state recurrence $h_t = \sigma(W h_{t-1} + U x_t)$, constraining $W \in O(n)$ to avoid vanishing/exploding gradients. During training, uses the Cayley parameterization $W = (I-A)(I+A)^{-1}$ ($A$ skew-symmetric), with backpropagation computing unconstrained gradients with respect to $A$. The core is matrix inversion $O(n^3)$ (acceptable for small layer dimensions).
30
31
  - **Poincaré embeddings (hyperbolic space)**: Embeds hierarchical data into the Poincaré ball $\mathcal{B}^n = \{x : \|x\| < 1\}$. Distance $d(x,y) = \text{arcosh}(1 + 2\|x-y\|^2 / ((1-\|x\|^2)(1-\|y\|^2)))$. The gradient is simply scaled by the metric factor $(1-\|x\|^2)^2/4$. Implemented as elementwise scaling, $O(d)$.
31
32
  - **Subspace learning on the Grassmann manifold**: Treats low-rank subspaces as points on the Grassmann manifold, updated online via Riemannian SGD. More suitable for streaming data than SVD. The projection $P = QQ^T$ update is implemented via QR decomposition, with the core being matmul + thin QR.
@@ -47,5 +48,18 @@ Optimization on smooth manifolds $\mathcal{M}$ (e.g., the orthogonal group $O(n)
47
48
 
48
49
  ## Further References
49
50
 
50
- - Distilled notes: references/books/matrix-analysis.md (Section 7.3 Polar Decomposition, Newton-Schulz Iteration, Section 2.6 SVD and Orthogonal Factors)
51
+ - Distilled notes: ../../references/books/matrix-analysis.en.md (Section 7.3 Polar Decomposition, Newton-Schulz Iteration, Section 2.6 SVD and Orthogonal Factors)
51
52
  - Original text: Horn & Johnson, *Matrix Analysis* 2nd Ed., Chapter 7 Section 7.3 (Polar Decomposition) + Absil, Mahony, Sepulchre, *Optimization Algorithms on Matrix Manifolds*, Princeton University Press, 2008
53
+
54
+
55
+ ## Routing Extensions
56
+ - If local linearization is needed -> `../differential-geometry/tangent-space.en.md` (gradient computation in tangent space)
57
+ - If retraction choice is needed -> `../differential-geometry/metric-tensor.en.md` (metric determines retraction map)
58
+ - If the metric comes from Fisher information -> `../information-geometry/natural-gradient.en.md` (natural gradient under Fisher metric)
59
+
60
+ ## Extensible Directions
61
+ - Retraction types: exponential map, projection retraction, Cayley transform
62
+ - Vector transport: transporting vectors between different tangent spaces on a manifold
63
+ - Riemannian conjugate gradient: conjugate gradient method on manifolds
64
+ - Riemannian trust region: trust region methods on manifolds
65
+ - Stochastic Riemannian optimization: SGD variants on manifolds
@@ -9,10 +9,11 @@
9
9
  - 黎曼梯度:$\text{grad} f(x) = \text{proj}_{T_x\mathcal{M}}(\nabla f(x))$(欧氏梯度投影到切空间)
10
10
  - 黎曼梯度下降:$x_{k+1} = R_{x_k}(-\alpha_k \cdot \text{grad} f(x_k))$,$R$ 为收缩映射(retraction)
11
11
  - 正交群 $O(n)$ 的切空间:$T_Q O(n) = \{Q\Omega : \Omega^T = -\Omega\}$(反对称矩阵左乘)
12
- - 正交群收缩映射(Cayley):$R_Q(\xi) = Q(I + \frac{1}{2}\Omega)^{-1}(I - \frac{1}{2}\Omega)$,$\xi = Q\Omega$
12
+ - 正交群收缩映射(Cayley):$R_Q(\xi) = Q(I + \frac{1}{2}\Omega)^{-1}(I - \frac{1}{2}\Omega)$,$\xi = Q\Omega$;等价地用 $A$-形式:设 $G = \nabla f(Q)$ 为欧氏梯度,$A = GQ^T - QG^T$(反对称),则 $R_Q(t) = (I + \frac{t}{2}A)^{-1}(I - \frac{t}{2}A)Q$,步长 $t > 0$ 沿负梯度方向移动(下降方向)
13
13
  - 极分解收缩:$R_Q(\xi) = (Q + \xi)(I + \xi^T\xi)^{-1/2}$(投影到最近正交矩阵)
14
14
  - Newton-Schulz 正交化:$X_{k+1} = \frac{1}{2}X_k(3I - X_k^T X_k)$,收敛到最近正交矩阵
15
15
  - 双曲空间(Poincaré ball):$\text{grad}_{\mathcal{H}} f = \frac{(1-\|x\|^2)^2}{4} \nabla f(x)$
16
+ - Stiefel 流形 $St(n,p) = \{W : W^TW = I_p\}$ 的黎曼梯度:$\text{grad} f(W) = G - W \cdot \text{sym}(W^TG)$,其中 $G = \nabla f(W)$ 为欧氏梯度,$\text{sym}(A) = \frac{A + A^T}{2}$ 为对称修正项。注意:不能简单用 $G - WW^TG$(正交投影),必须包含对称修正才能保证梯度在切空间中。
16
17
 
17
18
  ## 适用问题
18
19
 
@@ -24,8 +25,8 @@
24
25
 
25
26
  ## AI 设计翻译
26
27
 
27
- - **Muon 优化器 (正交化梯度更新)**:将动量矩阵 $M$ 通过 Newton-Schulz 迭代投影到最近正交矩阵:$X_{k+1} = \frac{1}{2}X_k(3I - X_k^TX_k)$,5 步收敛。更新 $W \leftarrow W - \alpha \cdot U$($U$ 为正交化结果)。核心是纯 matmul 链,每步 2 次 matmul,完全 tensor core 友好,bf16 稳定。
28
- - **谱归一化的流形视角**:约束 $\sigma_{\max}(W) = 1$ 等价于在 Stiefel 流形的某个切方向上做投影。Power iteration 估计方向 + 归一化 = 一种近似的黎曼梯度投影。实现同标准 spectral norm。
28
+ - **Muon 优化器 (正交化梯度更新)**:将缩放后的动量矩阵 $M$ 通过 Newton-Schulz / polar 迭代近似其正交极因子,例如 $X_{k+1} = \frac{1}{2}X_k(3I - X_k^TX_k)$(需先归一化并满足谱条件)。固定 5 步是工程近似而非无条件收敛保证。更新 $W \leftarrow W - \alpha \cdot U$($U$ 为正交化结果)。核心是 matmul 链,tensor core 友好,低精度下需缩放和残差监控。
29
+ - **谱归一化的流形视角**:约束 $\sigma_{\max}(W) \leq 1$ 的常用做法是按最大奇异值缩放权重,属于重参数化/归一化;它不是 Stiefel 流形切空间投影,也不是到谱范数球的精确最近投影。Power iteration 只用于估计最大奇异方向。
29
30
  - **正交 RNN (orthogonal RNN)**:隐藏状态递推 $h_t = \sigma(W h_{t-1} + U x_t)$,约束 $W \in O(n)$ 避免梯度消失/爆炸。训练时用 Cayley 参数化 $W = (I-A)(I+A)^{-1}$($A$ 反对称),反向传播走 $A$ 的无约束梯度。核心是矩阵求逆 $O(n^3)$(层维度小,可接受)。
30
31
  - **Poincaré 嵌入 (双曲空间)**:将层次数据嵌入 Poincaré ball $\mathcal{B}^n = \{x : \|x\| < 1\}$。距离 $d(x,y) = \text{arcosh}(1 + 2\|x-y\|^2 / ((1-\|x\|^2)(1-\|y\|^2)))$。梯度乘以度量因子 $(1-\|x\|^2)^2/4$ 即可。实现为 elementwise 缩放,$O(d)$。
31
32
  - **Grassmann 流形上的子空间学习**:将低秩子空间视为 Grassmann 流形上的点,用黎曼 SGD 在线更新。比 SVD 更适合 streaming 数据。投影 $P = QQ^T$ 的更新通过 QR 分解实现,核心是 matmul + thin QR。
@@ -47,5 +48,18 @@
47
48
 
48
49
  ## 深入参考
49
50
 
50
- - 蒸馏稿:references/books/matrix-analysis.md(§7.3 极分解、Newton-Schulz 迭代、§2.6 SVD 与正交因子)
51
+ - 蒸馏稿:../../references/books/matrix-analysis.md(§7.3 极分解、Newton-Schulz 迭代、§2.6 SVD 与正交因子)
51
52
  - 原书:Horn & Johnson, *Matrix Analysis* 2nd Ed., Chapter 7 §7.3 (Polar Decomposition) + Absil, Mahony, Sepulchre, *Optimization Algorithms on Matrix Manifolds*, Princeton University Press, 2008
53
+
54
+
55
+ ## 路由扩展
56
+ - 若需要局部线性化 → `../differential-geometry/tangent-space.md`(切空间上的梯度计算)
57
+ - 若需要收缩映射的具体选择 → `../differential-geometry/metric-tensor.md`(度量决定收缩映射)
58
+ - 若度量来自 Fisher 信息 → `../information-geometry/natural-gradient.md`(Fisher 度量下的自然梯度)
59
+
60
+ ## 可扩展方向
61
+ - 收缩映射类型(retraction types):指数映射、投影收缩、Cayley 变换
62
+ - 向量传输(vector transport):流形上向量在不同切空间间的传输
63
+ - 黎曼共轭梯度(Riemannian conjugate gradient):流形上的共轭梯度法
64
+ - 黎曼信赖域(Riemannian trust region):流形上的信赖域方法
65
+ - 随机黎曼优化(stochastic Riemannian optimization):流形上的 SGD 变体
@@ -1,6 +1,6 @@
1
- # Knowledge Base Navigation
1
+ # Mathematical Activation Anchor Index
2
2
 
3
- > This file is the v3 knowledge base index, helping you find specific knowledge cards from problem types.
3
+ > knowledge-base/ is not a closed encyclopedia but an activation entry point for high-frequency mathematical structures. Each card is an activation anchor that answers: what mathematical concept to activate, what deeper knowledge it connects to, what AI design actions it translates to, and where to extend when it is insufficient.
4
4
 
5
5
  ## Knowledge Base Structure
6
6
 
@@ -28,12 +28,24 @@ The knowledge base is organized by mathematical domain, with 7 domains and 31 kn
28
28
  | Need information compression | information-bottleneck, entropy, kl-divergence |
29
29
  | Need topological regularization | persistent-homology, euler-characteristic |
30
30
 
31
- ## Relationship to Thinking Lenses
31
+ ## When Anchors Are Not Enough
32
32
 
33
- Thinking lenses (`../lenses/`) handle "what perspective to use"; the knowledge base provides "concrete mathematical tools." Typical chain:
33
+ The current 31 anchors cover the most commonly used mathematical structures in AI research. When a problem requires mathematical tools not among them:
34
34
 
35
- ```
36
- Lens diagnosis Knowledge card provides tools Design pattern translates to AI module
37
- ```
35
+ 1. Check the corresponding domain's `*/index.en.md` (e.g., `topology/index.en.md`) for extended concepts and reference book directions
36
+ 2. Enter the **Knowledge Gap Protocol** defined in `../skills/math-research-activator/SKILL.en.md` to generate a temporary knowledge card
37
+ 3. Never respond with "knowledge base does not cover this" or force-fit the closest card
38
38
 
39
- For deeper study, `../references/books/*.md` provides 7 book distillations.
39
+ ## Domain Extension Index
40
+
41
+ Each domain has an `*/index.en.md` that lists: domain trigger signals, core anchors, extended concepts, reference book directions, and temporary activation rules.
42
+
43
+ | Domain | Extension Index |
44
+ |--------|----------------|
45
+ | Matrix Analysis | `matrix-analysis/index.en.md` |
46
+ | Optimization | `optimization/index.en.md` |
47
+ | Differential Geometry | `differential-geometry/index.en.md` |
48
+ | Lie Theory | `lie-theory/index.en.md` |
49
+ | Topology | `topology/index.en.md` |
50
+ | Probability & Information | `probability/index.en.md` |
51
+ | Information Geometry | `information-geometry/index.en.md` |
@@ -1,6 +1,6 @@
1
- # 数学知识库导航 / Knowledge Base Navigation
1
+ # 数学激活锚点索引 / Mathematical Activation Anchor Index
2
2
 
3
- > 本文件是 v3 知识库的索引,帮助你从问题类型找到具体的知识卡片。
3
+ > knowledge-base/ 不是封闭百科,而是高频数学结构的激活入口。每张卡片是一个激活锚点,回答:激活什么数学概念、连接哪些更深知识、可翻译成哪些 AI 设计动作、不足时应该往哪里扩展。
4
4
 
5
5
  ## 知识库结构
6
6
 
@@ -28,12 +28,24 @@
28
28
  | 需要信息压缩 | information-bottleneck, entropy, kl-divergence |
29
29
  | 需要拓扑正则 | persistent-homology, euler-characteristic |
30
30
 
31
- ## 与思想透镜的关系
31
+ ## 当锚点不够时
32
32
 
33
- 思想透镜(`../lenses/`)负责"用什么视角看问题",知识库负责"提供具体数学工具"。典型链路:
33
+ 现有 31 个锚点覆盖 AI 研究中最常用的数学结构。当问题需要的数学工具不在其中时:
34
34
 
35
- ```
36
- 透镜诊断 知识卡片提供工具 → 设计模式翻译成 AI 模块
37
- ```
35
+ 1. 查看对应领域的 `*/index.md`(如 `topology/index.md`),获取扩展概念和参考书方向
36
+ 2. 进入 SKILL.md 中定义的**知识缺口协议**,生成临时知识卡
37
+ 3. 不得回答"知识库未覆盖"或强行套用最相近卡片
38
38
 
39
- 深入查阅时,`../references/books/*.md` 提供 7 本书的蒸馏稿。
39
+ ## 领域扩展索引
40
+
41
+ 每个领域有一个 `*/index.md`,列出:领域触发信号、核心锚点、扩展概念、参考书方向、临时激活规则。
42
+
43
+ | 领域 | 扩展索引 |
44
+ |------|---------|
45
+ | 矩阵分析 | `matrix-analysis/index.md` |
46
+ | 最优化 | `optimization/index.md` |
47
+ | 微分几何 | `differential-geometry/index.md` |
48
+ | 李理论 | `lie-theory/index.md` |
49
+ | 拓扑 | `topology/index.md` |
50
+ | 概率与信息 | `probability/index.md` |
51
+ | 信息几何 | `information-geometry/index.md` |
@@ -39,7 +39,21 @@ $$P(|f(X_1,\ldots,X_n) - \mathbb{E}[f]| \geq t) \leq 2\exp\left(-\frac{2t^2}{\su
39
39
  - **Boundedness assumption violated**: Under heavy-tailed distributions (e.g., power laws), Hoeffding does not apply; Bernstein or truncation tricks are needed. In LLM training, when gradients occasionally take extreme values, naive concentration bounds yield a false sense of security.
40
40
 
41
41
  ## Further References
42
- - Distillation draft: `references/books/` — no dedicated probability distillation draft at present; this card is based on standard probability theory textbooks
42
+ - Distillation draft: `../../references/books/` — no dedicated probability distillation draft at present; this card is based on standard probability theory textbooks
43
43
  - Boucheron, Lugosi, Massart. *Concentration Inequalities: A Nonasymptotic Theory of Independence*. Oxford, 2013
44
44
  - Vershynin. *High-Dimensional Probability*. Cambridge, 2018 (Chapters 2-3)
45
- - Related knowledge cards: `probability/entropy.md`, `probability/fisher-information.md`
45
+ - Related knowledge cards: `entropy.en.md`, `fisher-information.en.md`
46
+
47
+
48
+ ## Routing Extensions
49
+ - If information-theoretic bounds are needed -> `entropy.en.md` (entropy-based concentration inequalities)
50
+ - If Donsker-Varadhan representation is needed -> `kl-divergence.en.md` (variational representation of KL divergence)
51
+ - If random matrix bounds are involved -> `../matrix-analysis/matrix-perturbation.md` (concentration behavior of random matrices)
52
+
53
+ ## Extensible Directions
54
+ - Martingale concentration (Azuma / Freedman): concentration inequalities for martingale differences
55
+ - Log-Sobolev inequalities: implying hypercontractivity and concentration
56
+ - Transportation inequalities: relationship between Wasserstein distance and relative entropy
57
+ - Talagrand's inequality: dimension-free concentration on product spaces
58
+ - Concentration on product spaces: concentration of functions of independent variables
59
+ - Dimension-free bounds: concentration bounds that do not degrade with dimension
@@ -39,7 +39,21 @@ $$P(|f(X_1,\ldots,X_n) - \mathbb{E}[f]| \geq t) \leq 2\exp\left(-\frac{2t^2}{\su
39
39
  - **有界性假设违反**:重尾分布(如幂律)下 Hoeffding 不适用,需改用 Bernstein 或截断技巧。在 LLM 训练中梯度偶尔出现极大值时,朴素浓度界给出虚假安全感。
40
40
 
41
41
  ## 深入参考
42
- - 蒸馏稿:`references/books/` 暂无专用概率蒸馏稿,本卡基于标准概率论教材
42
+ - 蒸馏稿:`../../references/books/` 暂无专用概率蒸馏稿,本卡基于标准概率论教材
43
43
  - Boucheron, Lugosi, Massart. *Concentration Inequalities: A Nonasymptotic Theory of Independence*. Oxford, 2013
44
44
  - Vershynin. *High-Dimensional Probability*. Cambridge, 2018(第 2-3 章)
45
- - 关联知识卡:`probability/entropy.md`、`probability/fisher-information.md`
45
+ - 关联知识卡:`entropy.md`、`fisher-information.md`
46
+
47
+
48
+ ## 路由扩展
49
+ - 若需要信息论界 → `entropy.md`(基于熵的集中不等式)
50
+ - 若需要 Donsker-Varadhan 表示 → `kl-divergence.md`(KL 散度的变分表示)
51
+ - 若涉及随机矩阵界 → `../matrix-analysis/matrix-perturbation.md`(随机矩阵的集中行为)
52
+
53
+ ## 可扩展方向
54
+ - 鞅集中(Azuma / Freedman):鞅差的集中不等式
55
+ - 对数 Sobolev 不等式(log-Sobolev inequalities):蕴含超收缩和集中
56
+ - 传输不等式(transportation inequalities):Wasserstein 距离与相对熵的关系
57
+ - Talagrand 不等式:乘积空间上的维度无关集中
58
+ - 乘积空间集中(concentration on product spaces):独立变量函数的集中
59
+ - 维度无关界(dimension-free bounds):不随维度退化的集中界