Derivatives of scalars, vector functions and matrices

本文介绍六种矩阵导数及其布局规范,包括标量、向量和矩阵的导数形式。通过矩阵操作简化复杂导数计算,并讨论了不同布局方式的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

There are six kinds of derivatives that can be expressed as matrices:




The partials with respect to the numerator are laid out according to the shape ofY while the partials with respect to the denominator are laid out according to the transpose ofX. For example, dy/dx is a column vector while dy/dx is a row vector (assumingx and y are column vectors—otherwise it is flipped). Each of these derivatives can be tediously computed via partials, but this section shows how they instead can be computed with matrix manipulations.



Assuming x and y are column vectors, A, X, Y are Matrix


This is where the operators and identities developed in the following sections are useful. For example, since the derivative ofY with respect to X cannot be represented by a matrix, it is customary to use dvec(Y)/dvec(X) instead (vec is defined below). If the purpose of differentiation is to equate the derivative to zero, then this transformation doesn’t affect the result. 




引用于Old and New Matrix Algebra Useful for Statistics Thomas P. Minka December 28, 2000



  Scalar y Vector y (size m) Matrix Y (size m×n)
Notation Type Notation Type Notation Type
Scalar x\frac{\partial y}{\partial x}scalar\frac{\partial \mathbf{y}}{\partial x}(numerator layout) size-m column vector

(denominator layout) size-m row vector

\frac{\partial \mathbf{Y}}{\partial x}(numerator layout) m×nmatrix
Vector x (size n)\frac{\partial y}{\partial \mathbf{x}}(numerator layout) size-n row vector

(denominator layout) size-n column vector

\frac{\partial \mathbf{y}}{\partial \mathbf{x}}(numerator layout) m×n matrix

(denominator layout) n×m matrix

\frac{\partial \mathbf{Y}}{\partial \mathbf{x}} ?
Matrix X (sizep×q)\frac{\partial y}{\partial \mathbf{X}}(numerator layout) q×p matrix

(denominator layout) p×q matrix

\frac{\partial \mathbf{y}}{\partial \mathbf{X}} ?\frac{\partial \mathbf{Y}}{\partial \mathbf{X}} ?

引用于https://en.wikipedia.org/wiki/Matrix_calculus#Layout_conventions


一般我们采用numerator layout


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值