标量对矩阵求导

网上的求导没有涉及到链式法则,稍微一复杂点我就不知道每个因式是否应该转秩,是放在左边还是右边。。。

而且标量对矩阵求导在博客上怎么也没找到,(找到的麻烦告诉我一声),最后在wiki上找到了。


看了半天,觉得Wiki上写的最全面,于是把里面最万能的精华部分拿了出来。

有了这几个公式,相信无论遇到多复杂的式子,只要结果能表示成矩阵,就肯定能轻松求出来了。

首先翻译一下文章大意:
 矩阵分析(求导)所用的符号主要分成了两大流派:最明显的区别在于当对标量求关于向量的导数时,结果到底是行向量还是列向量
张量(上下标)记号一般在物理里面用的多。
然后讲了标量、向量、矩阵互相求导的公式,具体的在此略过。
然后,重点来了!
如果写成微分的方式,就可以不用记那么多的公式了。

第一部分是微分的性质,第二部分是如何从微分转化为求导。

注意:

对矩阵求导是没有链式法则的!!!

注:wiki上好像没有求逆矩阵的微分公式,在此补上

 d( X^(-1) ) = - X^(-1)*dX*X^(-1);


以下转载自wikipedia:
 地址:https://en.wikipedia.org/wiki/Matrix_calculus#Scalar-by-matrix_identities

Identities in differential form[edit]

It is often easier to work in differential form and then convert back to normal derivatives. This only works well using the numerator layout. In these rules, "a" is a scalar.

Differential identities: scalar involving matrix [1] [6]
Condition Expression Result (numerator layout)
 d({\rm tr}(\mathbf{X})) ={\rm tr}(d\mathbf{X})
 d(|\mathbf{X}|) =|\mathbf{X}|{\rm tr}(\mathbf{X}^{-1}d\mathbf{X})
 d(\ln|\mathbf{X}|) ={\rm tr}(\mathbf{X}^{-1}d\mathbf{X})
Differential identities: matrix  [1] [6]
Condition Expression Result (numerator layout)
A is not a function of Xd(\mathbf{A}) =0
a is not a function of Xd(a\mathbf{X}) =a\,d\mathbf{X}
 d(\mathbf{X}+\mathbf{Y}) =d\mathbf{X}+d\mathbf{Y}
 d(\mathbf{X}\mathbf{Y}) =(d\mathbf{X})\mathbf{Y}+\mathbf{X}(d\mathbf{Y})
(Kronecker product)d(\mathbf{X} \otimes \mathbf{Y}) =(d\mathbf{X})\otimes\mathbf{Y}+\mathbf{X}\otimes(d\mathbf{Y})
(Hadamard product)d(\mathbf{X} \circ \mathbf{Y}) =(d\mathbf{X})\circ\mathbf{Y}+\mathbf{X}\circ(d\mathbf{Y})
 d(\mathbf{X}^\top) =(d\mathbf{X})^\top
(conjugate transpose)d(\mathbf{X}^{\rm H}) =(d\mathbf{X})^{\rm H}

To convert to normal derivative form, first convert it to one of the following canonical forms, and then use these identities:

Conversion from differential to derivative form  [1]
Canonical differential form Equivalent derivative form
dy = a\,dx\frac{dy}{dx} = a
dy = \mathbf{a}\,d\mathbf{x}\frac{dy}{d\mathbf{x}} = \mathbf{a}
dy = {\rm tr}(\mathbf{A}\,d\mathbf{X})\frac{dy}{d\mathbf{X}} = \mathbf{A}
d\mathbf{y} = \mathbf{a}\,dx\frac{d\mathbf{y}}{dx} = \mathbf{a}
d\mathbf{y} = \mathbf{A}\,d\mathbf{x}\frac{d\mathbf{y}}{d\mathbf{x}} = \mathbf{A}
d\mathbf{Y} = \mathbf{A}\,dx\frac{d\mathbf{Y}}{dx} = \mathbf{A}

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值