Cyan's Blog

Search

Search IconIcon to open search

D2L-5-拓展链式法则

Last updated Feb 2, 2022 Edit Source

# 拓展的求导链式法则

2022-02-02

Tags: #Math #Derivative

$$\begin{align} &\frac{\partial y}{\partial \mathbf{x}}=\frac{\partial y}{\partial u} \frac{\partial u}{\partial \mathbf{x}}\\ &\small{(1, n)}\quad{(1,1)(1,n)} \end{align}$$

$$\begin{align} &\frac{\partial y}{\partial \mathbf{x}}=\frac{\partial y}{\partial \mathbf{u}} \frac{\partial \mathbf{u}}{\partial \mathbf{x}}\\ &\small{(1, n)}\quad{(1,k)(k,n)} \end{align}$$

$$\begin{align} &\frac{\partial \mathbf{y}}{\partial \mathbf{x}}=\frac{\partial \mathbf{y}}{\partial \mathbf{u}} \frac{\partial \mathbf{u}}{\partial \mathbf{x}}\\ &\small{(m, n)}\quad{(m,k)(k,n)} \end{align}$$

# 例子: 线性回归

# 单个样本点的损失

$$\mathbf{x}, \mathbf{w} \in \mathbb{R}^{n}, \quad y \in \mathbb{R},\quad z=(\langle\mathbf{x}, \mathbf{w}\rangle-y)^{2}$$

:

# n个样本点的损失

$$\mathbf{X} \in \mathbb{R}^{m \times n}, \quad \mathbf{w} \in \mathbb{R}^{n}, \quad \mathbf{y} \in \mathbb{R}^{m}$$ $$ z=|\mathbf{X} \mathbf{w}-\mathbf{y}|^{2} $$

: