Files
Obsidian/Study/DL/吴恩达深度学习课程/矩阵求导.md

30 lines
571 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 概念
标量函数:输出为标量的函数
$$
f(x) = x^2
$$
向量函数:输出为向量/矩阵/张量的函数
$$
f(x) =
\left[ \begin{matrix}
x & x^2 \\
x^3 & x^4
\end{matrix} \right]
$$
$$
f(A) = B
$$
## 本质
$\frac{dB}{dA} = \frac{d(f(A))}{dA}$ 即 `B``A` 中的每个变量进行求导。
## 计算方法
- 求导结果采用分母布局(同一行是同一个分母)。
- 标量不变,向量拉伸。
- Y横向拉伸X纵向拉伸。
## 常见公式推导
1.
$$\begin{aligned}
f(X) = A^T \cdot X = \sum_{i=1}^{n}a_i x_i \\
d(f(X))
$$