1 引言
常見的求導(dǎo)有,標(biāo)量對標(biāo)量求導(dǎo),向量對標(biāo)量,矩陣對標(biāo)量,標(biāo)量對向量,向量對向量,標(biāo)量對矩陣。求導(dǎo)的幾種形式:
字符標(biāo)示:
A 大寫粗體表示矩陣
a 小寫粗體表示向量
a 小寫粗體表示標(biāo)量
tr(X) 表示跡,主對角線之和
det(X) or |X| 表示
字母表前面部分表示常量(如 a,b,c…),字母表后面部分表示變量(如 t,x,y,…)
2 向量的導(dǎo)數(shù)
2.1 向量對標(biāo)量求導(dǎo) Vector-by-scalar
y 向量為 y = [ y 1 y 2 ? y m ] T {\displaystyle \mathbf {y} ={\begin{bmatrix}y_{1}&y_{2}&\cdots &y_{m}\end{bmatrix}}^{\mathsf {T}}} y=[y1??y2????ym??]T, 對 x 求導(dǎo),結(jié)果為列
? y ? x = [ ? y 1 ? x ? y 2 ? x ? ? y m ? x ] {\displaystyle {\frac {\partial \mathbf {y} }{\partial x}}={\begin{bmatrix}{\frac {\partial y_{1}}{\partial x}}\\{\frac {\partial y_{2}}{\partial x}}\\\vdots \\{\frac {\partial y_{m}}{\partial x}}\\\end{bmatrix}}} ?x?y?=???????x?y1???x?y2????x?ym?????????
2.2 標(biāo)量對向量求導(dǎo) Scalar-by-vector
y 為標(biāo)量,對向量
x
=
[
x
1
x
2
?
x
n
]
T
{\displaystyle \mathbf {x} ={\begin{bmatrix}x_{1}&x_{2}&\cdots &x_{n}\end{bmatrix}}^{\mathsf {T}}}
x=[x1??x2????xn??]T 求導(dǎo),結(jié)果為行
2.3 向量對向量求導(dǎo) Vector-by-vector
輸出向量為
y
=
[
y
1
y
2
?
y
m
]
T
{\displaystyle \mathbf {y} ={\begin{bmatrix}y_{1}&y_{2}&\cdots &y_{m}\end{bmatrix}}^{\mathsf {T}}}
y=[y1??y2????ym??]T,
輸入向量為
x
=
[
x
1
x
2
?
x
n
]
T
{\displaystyle \mathbf {x} ={\begin{bmatrix}x_{1}&x_{2}&\cdots &x_{n}\end{bmatrix}}^{\mathsf {T}}}
x=[x1??x2????xn??]T
神經(jīng)網(wǎng)絡(luò)中全連接層的形式就是如此
這種矩陣也稱為雅各布矩陣
3 矩陣的導(dǎo)數(shù)
3.1 矩陣對標(biāo)量求導(dǎo) Matrix-by-scalar
3.2 標(biāo)量對矩陣求導(dǎo) Scalar-by-matrix
4 常用求導(dǎo)公式
字符標(biāo)示:
a, b, c, d, and e 為常量, 標(biāo)量 u, and v 由 x, x, or X中的一個計算而來;
a, b, c, d, and e 為常量向量, 向量 u, and v 由 x, x, or X中的一個計算而來;
A, B, B, D, and E 為常量矩陣, 向量 U, and V 由 x, x, or X中的一個計算而來;
4.1 向量對向量求導(dǎo)
4.2 標(biāo)量對向量求導(dǎo)
4.3 向量對標(biāo)量求導(dǎo)
4.4 標(biāo)量對矩陣求導(dǎo)
4.5 矩陣對標(biāo)量求導(dǎo)
4.6 標(biāo)量對標(biāo)量求導(dǎo)
文章來源:http://www.zghlxwxcb.cn/news/detail-409891.html
參考
Matrix calculus文章來源地址http://www.zghlxwxcb.cn/news/detail-409891.html
到了這里,關(guān)于矩陣求導(dǎo)常用公式的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!