常用矩阵求导公式速查

文章目录

  • 参考资料
  • 常用矩阵求导公式

参考资料

  • Matrix Calculu
  • The Matrix Cookbook

常用矩阵求导公式

对于一个矩阵A,向量 x \mathrm{x} x,有如下求导公式:
d x T d x = I , d x d x T = I (1) \tag{1} \frac{\mathrm{dx}^{\mathrm{T}}}{\mathrm{dx}}=I\text{,} \quad \quad \frac{\mathrm{dx}}{\mathrm{dx}^{\mathrm{T}}}=I dxdxT=I,dxTdx=I(1)

d x T A d x = A , d A x d x T = A (2) \tag{2} \begin{gathered} \frac{\mathrm{dx}^{\mathrm{T}} \mathrm{A}}{\mathrm{dx}}=\mathrm{A}\text{,} \quad \quad \quad \frac{\mathrm{dAx}}{\mathrm{dx}^{\mathrm{T}}}=\mathrm{A} \\ \end{gathered} dxdxTA=A,dxTdAx=A(2)

d A x d x = A T , d x A d x = A T (3) \tag{3} \begin{gathered} \frac{\mathrm{dAx}}{\mathrm{dx}}=\mathrm{A}^{\mathrm{T}}\text{,} \quad \quad \quad \frac{\mathrm{dxA}}{\mathrm{dx}}=\mathrm{A}^{\mathrm{T}} \end{gathered} dxdAx=AT,dxdxA=AT(3)

d x T x d x = 2 x , d x T A x d x = ( A + A T ) x (4-1) \tag{4-1} \begin{gathered} \frac{\mathrm{dx}^{\mathrm{T}} \mathrm{x}}{\mathrm{dx}}=2 \mathrm{x} \text{,} \quad \quad \frac{\mathrm{dx}^{\mathrm{T}} \mathrm{Ax}}{\mathrm{dx}}=\left(\mathrm{A}+\mathrm{A}^{\mathrm{T}}\right) \mathrm{x} \end{gathered} dxdxTx=2x,dxdxTAx=(A+AT)x(4-1)
d x T A x d x x T = d d x ( d x T A x d x ) = A T + A (4-2) \tag{4-2} \frac{\mathrm{dx}^{\mathrm{T}}\mathrm {A x}}{\mathrm{d x x}^{\mathrm{T}}}=\frac{d}{ \mathrm{d x}}\left(\frac{\mathrm{ dx}^{\mathrm{T}} \mathrm{A x}}{ \mathrm{d x}}\right)=\mathrm{A}^{\mathrm{T}}+\mathrm{A} dxxTdxTAx=dxd(dxdxTAx)=AT+A(4-2)

∂ u ∂ x T = ( ∂ u T ∂ x ) T (5-1) \tag{5-1} \frac{\partial \mathrm{u}}{\partial \mathrm{x}^{\mathrm{T}}}=\left(\frac{\partial \mathrm{u}^{\mathrm{T}}}{\partial \mathrm{x}}\right)^{\mathrm{T}} xTu=(xuT)T(5-1)
∂ u T v ∂ x = ∂ u T ∂ x v + ∂ v T ∂ x u T , ∂ u v T ∂ x = ∂ u ∂ x v T + u ∂ v T ∂ x (5-2) \tag{5-2} \begin{aligned} \frac{\partial \mathrm{u}^{\mathrm{T}} \mathrm{v}}{\partial \mathrm{x}}=\frac{\partial \mathrm{u}^{\mathrm{T}}}{\partial \mathrm{x}} \mathrm{v}+\frac{\partial \mathrm{v}^{\mathrm{T}}}{\partial \mathrm{x}} \mathrm{u}^{\mathrm{T}} \text{,} \quad \quad \frac{\partial \mathrm{uv}^{\mathrm{T}}}{\partial \mathrm{x}}=\frac{\partial \mathrm{u}}{\partial \mathrm{x}} \mathrm{v}^{\mathrm{T}}+\mathrm{u} \frac{\partial \mathrm{v}^{\mathrm{T}}}{\partial \mathrm{x}} \end{aligned} xuTv=xuTv+xvTuT,xuvT=xuvT+uxvT(5-2)

∂ [ ( x u − v ) T ( x u − v ) ] ∂ x = 2 ( x u − v ) u T (6) \tag{6} \frac{\partial\left[(\mathrm{xu}-\mathrm{v})^{\mathrm{T}}(\mathrm{x} u-\mathrm{v})\right]}{\partial \mathrm{x}}=2(\mathrm{xu}-\mathrm{v}) \mathrm{u}^{\mathrm{T}} x[(xuv)T(xuv)]=2(xuv)uT(6)

∂ u T x v ∂ x = u v T , ∂ u T x T x u ∂ x = 2 x u u T (7) \tag{7} \begin{gathered} \frac{\partial \mathrm{u}^{\mathrm{T}} \mathrm{xv}}{\partial \mathrm{x}}=\mathrm{uv}^{\mathrm{T}} \text{,} \quad \quad \frac{\partial \mathrm{u}^{\mathrm{T}} \mathrm{x}^{\mathrm{T}} \mathrm{xu}}{\partial \mathrm{x}}=2 \mathrm{xuu}^{\mathrm{T}} \end{gathered} xuTxv=uvT,xuTxTxu=2xuuT(7)

特别地,当 A = A T A=A^T A=AT时,公式(4-1)和公式(4-2)有
d x T A x d x = 2 A x (8) \tag{8} \begin{gathered} \frac{\mathrm{dx}^{\mathrm{T}} \mathrm{Ax}}{\mathrm{dx}}=2\mathrm{A}\mathrm{x} \end{gathered} dxdxTAx=2Ax(8)
d x T A x d x x T = 2 A (9) \tag{9} \frac{ \mathrm{dx}^{\mathrm{T}}\mathrm {A x}}{\mathrm{dx x}^{\mathrm{T}}}=2\mathrm{A} dxxTdxTAx=2A(9)

你可能感兴趣的:(数学,矩阵,线性代数,机器学习)