20 / 90

Day 20: 偏导数与梯度向量

一次只对一个变量求导,组装梯度向量,并证明共享依赖路径的贡献会相加。每个论断都用手算、有限差分或直接代入检验。

AI 数学与微积分/代数 480 分钟主动学习(8 小时专注学习)
01 120 分钟

偏导数:冻结其余所有变量

只有在记录预测和观察证据之后才允许求助。

前提条件

Day 19 的链式法则练习;若标量法则不熟,先打开当天恢复链接再继续。

学习目标

把偏导数定义为冻结其他变量后沿单轴的普通导数,手算多项式的两个偏导数,并用有限差分确认。

操作说明

学习来源:在本活动现有的阅读与练习时段内,参考 MIT OCW 18.02SC Multivariable Calculus 的 Part 2: Partial Derivatives; differentiation, chain rule and gradient sessions,用自己的话解释一处与本地任务的联系。保留现有练习与验收检查;若外部资料无法访问,使用课程自写的解释。对 f(x, y) = x^2 y + 3y - x,冻结 y 对 x 求导:∂f/∂x = 2xy - 1。冻结 x 对 y 求导:∂f/∂y = x^2 + 3。在点 (2, 1):f = 4*1 + 3 - 2 = 5,∂f/∂x = 4 - 1 = 3,∂f/∂y = 4 + 3 = 7。先用中心差分检验前请预测:(f(2.00001, 1) - f(1.99999, 1)) / 0.00002 趋近 3,y 方向切片趋近 7。

练习与预测记录

手算并数值验证:(a) f(x, y) = x^2 y + 3y - x 在 (2, 1) 处的两个偏导数;(b) f(x, y) = x y^2 在 (3, 2) 处的两个偏导数。每一步求导都记录被冻结的变量。

独立掌握标准

无帮助下算出两个函数的全部偏导数,说明每行冻结了哪个变量,且 3、7、4、12 四个值都与你亲自运行的有限差分一致。

权威源资源与出处

linking CC BY-NC-SA 4.0 noncommercial share-alike

MIT OCW 18.02SC Multivariable Calculus

作者/机构: MIT OpenCourseWare (Prof. Denis Auroux) | 原始链接 ↗

相关章节/时间戳: Part 2: Partial Derivatives; differentiation, chain rule and gradient sessions

验证版本与日期: Fall 2010 (Verified: 2026-10-30)

选择理由:

Rigorous university-lecture treatment that lets motivated learners go deeper on partial derivatives and the gradient after the OpenStax primary text.

源前提知识:

Single-variable calculus and coordinate geometry

安全回退(离线韧性):

All required formulas, worked examples, and numeric checks are contained in the localized lesson text.

候选源比较与选择分析 (2)
OpenStax Calculus Volume 3 ↗ compared_selected_for_day20 [CC BY-NC-SA 4.0]

Chosen as the primary written reference; MIT OCW is the deeper lecture companion.

Khan Academy: Multivariable Calculus ↗ compared_alternative [CC BY-NC-SA 4.0]

More accessible pacing but less rigorous than the Auroux lectures for the path-sum chain rule.

linking CC BY-NC-SA 4.0 attribution noncommercial share-alike

OpenStax Calculus Volume 3

作者/机构: OpenStax, Rice University (Gilbert Strang, Edwin Herman, et al.) | 原始链接 ↗

相关章节/时间戳: Section 4.3 Partial Derivatives: definition, notation, and worked examples

验证版本与日期: OpenStax Calculus Volume 3 web edition (verified 2026-10-30)

选择理由:

Openly licensed primary definition of the partial derivative matching the day's slice-and-differentiate method.

源前提知识:

Single-variable derivatives and the chain rule (Study Days 16-19).

安全回退(离线韧性):

The lesson contains complete local derivations, worked answers, and a finite-difference check.

候选源比较与选择分析 (2)
MIT OCW 18.02SC Multivariable Calculus (Prof. Denis Auroux) ↗ compared_selected_for_day20 [CC BY-NC-SA 4.0]

Selected as the lecture-depth companion for partial derivatives; OpenStax Volume 3 remains the written primary reference.

Khan Academy: Multivariable Calculus ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong visual coverage of gradients, but the OpenStax text better matches the lesson's theorem-plus-hand-check structure.

02 120 分钟

梯度向量指向最陡上升方向

独立练习:先预测并保留已记录的无协助尝试;之后的任何帮助属于单独的“协助式补救”阶段,须再通过一次新的同等无协助检查,该概念才算独立证据。

前提条件

完成上一项活动;若受阻请使用列出的恢复链接。

学习目标

把偏导数组装为梯度向量,归一化为单位方向,并验证沿梯度方向的方向导数等于梯度的模长。

操作说明

梯度是 ∇f = (∂f/∂x, ∂f/∂y)。对 f(x, y) = x^2 + y^2,∇f = (2x, 2y)。在 (3, 4) 处:∇f = (6, 8),模长 sqrt(36 + 64) = 10,单位方向 (0.6, 0.8)。关键事实:沿梯度方向的方向导数等于其模长。计算前先预测小 h 时 (f(3 + 0.6h, 4 + 0.8h) - f(3, 4)) / h 的值;它应趋近 10。 若在保留的尝试之后求助,按“协助式补救”处理:原尝试保持不变,在称为已补救之前须通过一次新的同等无协助检查。

练习与预测记录

手算:(a) f(x, y) = x^2 + y^2 在 (3, 4) 处的 ∇f 及模长,并验证沿单位梯度方向的方向导数趋近模长;(b) f(x, y) = xy + y^2 在 (1, 2) 处的 ∇f 及模长。

独立掌握标准

无帮助下给出两个梯度 (6, 8) 与 (2, 5)、两个模长 10 与 sqrt(29) ≈ 5.385,并对 (a) 数值验证沿单位梯度方向的斜率等于模长。

权威源资源与出处

linking CC BY-NC-SA 4.0 attribution noncommercial share-alike

OpenStax Calculus Volume 3

作者/机构: OpenStax, Rice University (Gilbert Strang, Edwin Herman, et al.) | 原始链接 ↗

相关章节/时间戳: Section 4.6: the gradient is the direction of maximum increase with magnitude equal to that rate

验证版本与日期: OpenStax Calculus Volume 3 web edition (verified 2026-10-30)

选择理由:

States and proves the steepest-ascent property verified numerically in the exercise.

源前提知识:

Partial derivatives (day-20-act-01).

安全回退(离线韧性):

The exercise derives the norm equality locally and checks it with a finite difference.

候选源比较与选择分析 (2)
MIT OCW 18.02SC Multivariable Calculus (Prof. Denis Auroux) ↗ compared_selected_for_day20 [CC BY-NC-SA 4.0]

Selected as the lecture-depth companion for partial derivatives; OpenStax Volume 3 remains the written primary reference.

Khan Academy: Multivariable Calculus ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong visual coverage of gradients, but the OpenStax text better matches the lesson's theorem-plus-hand-check structure.

linking 3Blue1Brown copyright (all rights reserved); site FAQ permits only short clips under stated conditions No video, audio, transcript or frame redistribution permitted

Gradient Descent, How Neural Networks Learn

作者/机构: Grant Sanderson (3Blue1Brown) | 原始链接 ↗

相关章节/时间戳: Chapter 2 video: the gradient points in the direction of steepest increase

验证版本与日期: 2017 video release (verified 2026-10-30)

选择理由:

Visual motivation for why gradient descent moves downhill, connecting the math to later optimization days.

源前提知识:

Partial derivative intuition from the previous activity.

安全回退(离线韧性):

The steepest-ascent fact is stated and verified numerically in the local content.

候选源比较与选择分析 (2)
OpenStax Calculus Volume 3 Section 4.6 ↗ compared_selected_for_day20 [CC BY-NC-SA 4.0]

Chosen as the primary written source proving the steepest-ascent theorem; 3Blue1Brown supplies the ML-motivation layer.

Khan Academy: The gradient ↗ compared_alternative [Proprietary (free course)]

Free interactive drills on the same gradient concept; the 3Blue1Brown video was retained for its visual-first derivation of steepest descent.

03 120 分钟

多元链式法则:共享路径的贡献相加

只有在记录预测和观察证据之后才允许求助。

前提条件

完成上一项活动;若受阻请使用列出的恢复链接。

学习目标

应用多元链式法则 dz/dt = (∂f/∂x)(dx/dt) + (∂f/∂y)(dy/dt),用直接代入验证,并证明同一变量出现在两条路径上时贡献是两次而非一次。

操作说明

设 z = f(x, y) = xy,其中 x = t^2,y = 3t。链式法则给出 dz/dt = y * 2t + x * 3 = 6t^2 + 3t^2 = 9t^2。先代入检验:z = 3t^3,dz/dt = 9t^2——一致。再看共享变量情形:L = a*b,b = a + 1。a 通过两条路径影响 L:直接进入第一个因子(贡献 b),再通过 b 进入第二个因子(贡献 a * db/da = a * 1)。总计 dL/da = b + a = 2a + 1。只算一条路径就是可复用变量的反例。

练习与预测记录

计算并验证:(a) z = xy,x = t^2,y = 3t 时 t = 2 处的 dz/dt——分别用链式法则和代入 z = 3t^3;(b) L = a*b,b = a + 1 时 a = 3 处的 dL/da,写出两条路径的贡献以及只算单条路径的错误答案。

独立掌握标准

为每题写出两条路径的乘积项,用独立方法确认 36 和 7,并能用一句话解释可复用变量为何必须对贡献求和而非只取其一。

权威源资源与出处

linking CC BY-NC-SA 4.0 attribution noncommercial share-alike

OpenStax Calculus Volume 3

作者/机构: OpenStax, Rice University (Gilbert Strang, Edwin Herman, et al.) | 原始链接 ↗

相关章节/时间戳: Section 4.5: dz/dt equals the sum of partial-derivative products over all paths

验证版本与日期: OpenStax Calculus Volume 3 web edition (verified 2026-10-30)

选择理由:

Primary statement of the tree-diagram rule that the day's shared-path counterexample verifies.

源前提知识:

Scalar chain rule (day-19) and partial derivatives (day-20-act-01).

安全回退(离线韧性):

Both worked examples are derived locally and cross-checked against direct substitution.

候选源比较与选择分析 (2)
MIT OCW 18.02SC Multivariable Calculus (Prof. Denis Auroux) ↗ compared_selected_for_day20 [CC BY-NC-SA 4.0]

Selected as the lecture-depth companion for partial derivatives; OpenStax Volume 3 remains the written primary reference.

Khan Academy: Multivariable Calculus ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong visual coverage of gradients, but the OpenStax text better matches the lesson's theorem-plus-hand-check structure.

linking CC BY-NC-SA 4.0 attribution noncommercial share-alike

OpenStax Calculus Volume 1

作者/机构: OpenStax, Rice University (Gilbert Strang, Edwin Herman, et al.) | 原始链接 ↗

相关章节/时间戳: Section 3.6: scalar chain rule used to check each path product

验证版本与日期: OpenStax Calculus Volume 1 web edition (verified 2026-10-30)

选择理由:

Recovery reference for the single-variable products inside the multivariable sum.

源前提知识:

Derivative rules for powers and polynomials (Study Days 16-18).

安全回退(离线韧性):

Day 19 content already covers the scalar rule; this link is optional review.

候选源比较与选择分析 (3)
MIT OpenCourseWare 18.01SC Single Variable Calculus ↗ compared_selected_for_visual_practice [CC BY-NC-SA 4.0]

Strong exercises and transcripts, but the noncommercial share-alike terms and course navigation make OpenStax the primary stable text.

Paul's Online Math Notes: Calculus I ↗ compared_rejected_for_reuse [All Rights Reserved]

Useful reference, but rights and redistribution terms are less suitable for embedded recovery material.

SciPy Numerical Differentiation Documentation ↗ compared_selected_for_numerics [BSD-3-Clause]

A primary API reference for numerical derivative step-size behavior; it complements rather than replaces the hand derivation.

04 120 分钟

独立掌握检查:梯度、验证与边界情形

独立掌握检查(不使用 AI 协助)。

前提条件

完成上一项活动;若受阻请使用列出的恢复链接。

学习目标

在闭卷条件下计算梯度及其模长,数值验证最陡上升性质,并指出梯度不存在的点。

操作说明

检查期间不看笔记、不用 AI。第 1 部分:计算 f(x, y) = x^2 + 2y^2 在 (1, 1) 处的 ∇f 和 ||∇f||。第 2 部分:数值验证沿单位梯度方向前进时 f 上升最快——方向导数等于模长。第 3 部分:f(x, y) = |x| + |y| 在 (0, 0) 处:比较沿各轴从左、从右逼近的斜率,说明两个偏导数在该点都不存在。

练习与预测记录

提交:第 1 部分的梯度与模长、第 2 部分的验证数值、第 3 部分的矛盾斜率,以及一句解释该点梯度为何无定义。

独立掌握标准

无帮助下三部分全部正确:(2, 4) 且模长 2*sqrt(5) ≈ 4.4721 经方向验证,-1/+1 斜率矛盾得到正确解释,另附对遗漏内容的诚实恢复记录。

权威源资源与出处

linking CC BY-NC-SA 4.0 attribution noncommercial share-alike

OpenStax Calculus Volume 3

作者/机构: OpenStax, Rice University (Gilbert Strang, Edwin Herman, et al.) | 原始链接 ↗

相关章节/时间戳: Section 4.6: gradient exists only where the partial derivatives exist

验证版本与日期: OpenStax Calculus Volume 3 web edition (verified 2026-10-30)

选择理由:

Frames the nondifferentiable edge case in the mastery check.

源前提知识:

Partial derivatives and the multivariable chain rule.

安全回退(离线韧性):

The edge case is analyzed locally with directional slopes that disagree.

候选源比较与选择分析 (2)
MIT OCW 18.02SC Multivariable Calculus (Prof. Denis Auroux) ↗ compared_selected_for_day20 [CC BY-NC-SA 4.0]

Selected as the lecture-depth companion for partial derivatives; OpenStax Volume 3 remains the written primary reference.

Khan Academy: Multivariable Calculus ↗ compared_alternative [CC BY-NC-SA 4.0]

Strong visual coverage of gradients, but the OpenStax text better matches the lesson's theorem-plus-hand-check structure.

linking PSF License Version 2

The Python Tutorial: Numbers and Expressions

作者/机构: Python Software Foundation | 原始链接 ↗

相关章节/时间戳: Section 3.1.1 Numbers: arithmetic used by the finite-difference checks

验证版本与日期: Python 3.12 documentation (verified 2026-10-30)

选择理由:

Reference for the verification arithmetic used in the mastery check.

源前提知识:

Able to run a short Python file from the terminal.

安全回退(离线韧性):

The verification snippets are embedded and run on a standard Python install.

候选源比较与选择分析 (2)
math — Mathematical functions ↗ compared_alternative [PSF License Version 2]

Extends the operator set to transcendental functions; kept as a follow-on once the arithmetic expressions are fluent.

The Python Tutorial: Floating Point Arithmetic Issues ↗ compared_alternative [PSF License Version 2]

Explains binary float representation limits; deferred to the numerics days where tolerance reasoning is rehearsed.