# 向量和矩阵的微分

## 列向量对元素求导

$\mathbf{\text{y}}=\left[{y}_{1},{y}_{2},...,{y}_{d}{\right]}^{T}\in {R}^{d},x\in R,\frac{\mathrm{\partial }\mathbf{\text{y}}}{\mathrm{\partial }x}={\left[\frac{\mathrm{\partial }{y}_{1}}{x},\frac{\mathrm{\partial }{y}_{2}}{x},\dots ,\frac{\mathrm{\partial }{y}_{d}}{x}\right]}^{T}$

## 矩阵对元素求导

$Y=\left[\begin{array}{ccc}{y}_{11}& \dots & {y}_{1d}\\ ⋮& \ddots & ⋮\\ {y}_{d1}& \dots & {y}_{dd}\end{array}\right]\in {R}^{d×d},x\in R,\frac{\mathrm{\partial }Y}{\mathrm{\partial }x}=\left[\begin{array}{ccc}\frac{\mathrm{\partial }{y}_{11}}{\mathrm{\partial }x}& \dots & \frac{\mathrm{\partial }{y}_{1d}}{\mathrm{\partial }x}\\ ⋮& \ddots & ⋮\\ \frac{\mathrm{\partial }{y}_{d1}}{\mathrm{\partial }x}& \dots & \frac{\mathrm{\partial }{y}_{dd}}{\mathrm{\partial }x}\end{array}\right]$

## 元素对向量求导

$y\in R,\mathbf{\text{x}}=\left[{x}_{1},{x}_{2},...,{x}_{d}{\right]}^{T}\in {R}^{d},\frac{\mathrm{\partial }y}{\mathrm{\partial }\mathbf{\text{x}}}={\left[\frac{\mathrm{\partial }y}{{x}_{1}},\frac{\mathrm{\partial }y}{{x}_{2}},\dots ,\frac{\mathrm{\partial }y}{{x}_{d}}\right]}^{T}$

## 元素对矩阵求导

$y\in R,X=\left[\begin{array}{ccc}{x}_{11}& \dots & {x}_{1d}\\ ⋮& \ddots & ⋮\\ {x}_{d1}& \dots & {x}_{dd}\end{array}\right]\in {R}^{d×d},\frac{\mathrm{\partial }y}{\mathrm{\partial }X}=\left[\begin{array}{ccc}\frac{\mathrm{\partial }y}{\mathrm{\partial }{x}_{11}}& \dots & \frac{\mathrm{\partial }y}{\mathrm{\partial }{x}_{1d}}\\ ⋮& \ddots & ⋮\\ \frac{\mathrm{\partial }y}{\mathrm{\partial }{x}_{d1}}& \dots & \frac{\mathrm{\partial }y}{\mathrm{\partial }{x}_{dd}}\end{array}\right]$

## 列向量对列向量求导

$\mathbf{\text{y}}=\left[{y}_{1},\dots ,{y}_{d}{\right]}^{T}\in {R}^{d},\mathbf{\text{x}}=\left[{x}_{1},{x}_{2},...,{x}_{d}{\right]}^{T}\in {R}^{d}\phantom{\rule{0ex}{0ex}}\frac{\mathrm{\partial }\mathbf{\text{y}}}{\mathrm{\partial }\mathbf{\text{x}}}={\left[\frac{\mathrm{\partial }{y}_{1}}{\mathbf{\text{x}}},\frac{\mathrm{\partial }{y}_{2}}{\mathbf{\text{x}}},\dots ,\frac{\mathrm{\partial }{y}_{d}}{\mathbf{\text{x}}}\right]}^{T}$

## 列向量对矩阵求导

$\mathbf{\text{y}}=\left[{y}_{1},{y}_{2},\dots ,{y}_{d}\right]\in {R}^{d},X=\left[\begin{array}{ccc}{x}_{11}& \dots & {x}_{1d}\\ ⋮& \ddots & ⋮\\ {x}_{d1}& \dots & {x}_{dd}\end{array}\right]\in {R}^{d×d}\phantom{\rule{0ex}{0ex}}\frac{\mathrm{\partial }\mathbf{\text{y}}}{\mathrm{\partial }X}=\left[\frac{\mathrm{\partial }{y}_{1}}{\mathrm{\partial }X},\dots ,\frac{\mathrm{\partial }{y}_{d}}{\mathrm{\partial }X}\right]$

## 矩阵对列向量求导

$Y=\left[\begin{array}{ccc}{y}_{11}& \dots ,& {y}_{d1}\\ ⋮& \ddots & ⋮\\ {y}_{d1}& \dots & {y}_{dd}\end{array}\right]\in {R}^{d×d},\mathbf{\text{x}}=\left[{x}_{1},{x}_{2},...,{x}_{d}{\right]}^{T}\in {R}^{d}\phantom{\rule{0ex}{0ex}}\frac{\mathrm{\partial }Y}{\mathrm{\partial }\mathbf{\text{x}}}=\left[\begin{array}{ccc}\frac{\mathrm{\partial }{y}_{11}}{\mathrm{\partial }\mathbf{\text{x}}}& \dots & \frac{\mathrm{\partial }{y}_{1d}}{\mathrm{\partial }\mathbf{\text{x}}}\\ ⋮& \ddots & ⋮\\ \frac{\mathrm{\partial }{y}_{1d}}{\mathrm{\partial }\mathbf{\text{x}}}& \dots & \frac{\mathrm{\partial }{y}_{dd}}{\mathrm{\partial }\mathbf{\text{x}}}\end{array}\right]$

## 矩阵对列向量求导

$Y=\left[\begin{array}{ccc}{y}_{11}& \dots ,& {y}_{d1}\\ ⋮& \ddots & ⋮\\ {y}_{d1}& \dots & {y}_{dd}\end{array}\right]\in {R}^{d×d},X=\left[\begin{array}{ccc}{x}_{11}& \dots ,& {x}_{d1}\\ ⋮& \ddots & ⋮\\ {x}_{d1}& \dots & {x}_{dd}\end{array}\right]=\left[{\mathbf{\text{x}}}_{1},{\mathbf{\text{x}}}_{2},...,{\mathbf{\text{x}}}_{d}\right]\in {R}^{d×d}\phantom{\rule{0ex}{0ex}}\frac{\mathrm{\partial }Y}{\mathrm{\partial }X}=\left[\frac{\mathrm{\partial }Y}{\mathrm{\partial }{\mathbf{\text{x}}}_{1}},\dots ,\frac{\mathrm{\partial }Y}{\mathrm{\partial }{\mathbf{\text{x}}}_{d}}\right]$

## 向量和矩阵的乘积求导

$\frac{\mathrm{\partial }{\mathbf{\text{a}}}^{T}\mathbf{\text{x}}}{\mathrm{\partial }x}=\frac{\mathrm{\partial }{\mathbf{\text{x}}}^{T}\mathbf{\text{a}}}{\mathrm{\partial }x}=\mathbf{\text{a}}\phantom{\rule{2em}{0ex}}\frac{\mathrm{\partial }A\mathbf{\text{x}}}{\mathrm{\partial }\mathbf{\text{x}}}={A}^{T}\phantom{\rule{2em}{0ex}}\frac{\mathrm{\partial }{\mathbf{\text{x}}}^{T}A}{\mathrm{\partial }\mathbf{\text{x}}}=A\phantom{\rule{2em}{0ex}}\frac{\mathrm{\partial }\mathbf{\text{x}}}{\mathrm{\partial }\mathbf{\text{x}}}=\mathbf{\text{I}}\phantom{\rule{0ex}{0ex}}\frac{\mathrm{\partial }{\mathbf{\text{x}}}^{T}B\mathbf{\text{x}}}{\mathrm{\partial }\mathbf{\text{x}}}=\left(B+{B}^{T}\right)\mathbf{\text{x}}\phantom{\rule{2em}{0ex}}\frac{\mathrm{\partial }{U}^{T}XV}{\mathrm{\partial }X}=U{V}^{T}$

## 逆矩阵和行列式求导

$\frac{\mathrm{\partial }{Y}^{-1}}{\mathrm{\partial }x}=-{Y}^{-1}\frac{\mathrm{\partial }Y}{\mathrm{\partial }x}{Y}^{-1}\phantom{\rule{2em}{0ex}}\frac{\mathrm{\partial }det\left(X\right)}{\mathrm{\partial }X}=det\left(X\right)\left({X}^{-1}{\right)}^{T}$

## 复合函数求导

$\mathbf{\text{u}}=\mathbf{\text{u(x)}}⇒\frac{\mathrm{\partial }\mathbf{\text{Au}}}{\mathrm{\partial }\mathbf{\text{x}}}=\frac{\mathrm{\partial }\mathbf{\text{u}}}{\mathrm{\partial }\mathbf{\text{x}}}{\mathbf{\text{A}}}^{T}\phantom{\rule{0ex}{0ex}}\mathbf{\text{u}}=\mathbf{\text{u(x)}},\mathbf{\text{v}}=\mathbf{\text{v(x)}}⇒\frac{\mathrm{\partial }{\mathbf{\text{u}}}^{T}\mathbf{\text{v}}}{\mathrm{\partial }\mathbf{\text{x}}}=\frac{\mathrm{\partial }{\mathbf{\text{u}}}^{T}}{\mathrm{\partial }\mathbf{\text{x}}}\mathbf{\text{v}}+\frac{\mathrm{\partial }{\mathbf{\text{v}}}^{T}}{\mathrm{\partial }\mathbf{\text{x}}}{\mathbf{\text{u}}}^{T}$

• 广告
• 抄袭
• 版权
• 政治
• 色情
• 无意义
• 其他

120