Search
Search Icon Icon to open search 矩阵的不同乘法-Hadamard-Kronecker Last updated
Feb 1, 2022
Edit Source
# 矩阵的不同乘积2022-02-01
Tags: #Matrix #Math
# 一般的矩阵乘法
# Hadamard Product ⊙ \odot ⊙ 对应位置的元素相乘
[ a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 ] ∘ [ b 11 b 12 b 13 b 21 b 22 b 23 b 31 b 32 b 33 ] = [ a 11 , b 11 a 12 , b 12 a 13 , b 13 a 21 , b 21 a 22 , b 22 a 23 , b 23 a 31 , b 31 a 32 , b 32 a 33 , b 33 ] \begin{bmatrix}
a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33}
\end{bmatrix} \circ \begin{bmatrix}
b_{11} & b_{12} & b_{13}\\ b_{21} & b_{22} & b_{23}\\ b_{31} & b_{32} & b_{33}
\end{bmatrix} = \begin{bmatrix}
a_{11}, b_{11} & a_{12}, b_{12} & a_{13}, b_{13}\\ a_{21}, b_{21} & a_{22}, b_{22} & a_{23}, b_{23}\\ a_{31}, b_{31} & a_{32}, b_{32} & a_{33}, b_{33}
\end{bmatrix} ⎣ ⎡ a 11 a 21 a 31 a 12 a 22 a 32 a 13 a 23 a 33 ⎦ ⎤ ∘ ⎣ ⎡ b 11 b 21 b 31 b 12 b 22 b 32 b 13 b 23 b 33 ⎦ ⎤ = ⎣ ⎡ a 11 , b 11 a 21 , b 21 a 31 , b 31 a 12 , b 12 a 22 , b 22 a 32 , b 32 a 13 , b 13 a 23 , b 23 a 33 , b 33 ⎦ ⎤
Hadamard product 符号表示为: A ∘ B A \circ B A ∘ B or A ⊙ B A \odot B A ⊙ B
# Kronecker Product ⨂ \bigotimes ⨂ 克罗内克积(英语:Kronecker product)是两个任意大小的矩阵间的运算,表示为⨂ \bigotimes ⨂ 。克罗内克积是外积从向量到矩阵的推广,也是张量积在标准基下的矩阵表示。 类似于外积: 对于向量:v = [ v 1 v 2 ⋮ v n ] \mathbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix} v = ⎣ ⎡ v 1 v 2 ⋮ v n ⎦ ⎤
和
w = [ w 1 w 2 ⋮ w m ] \mathbf{w} = \begin{bmatrix} w_1 \\ w_2 \\ \vdots \\ w_m \end{bmatrix} w = ⎣ ⎡ w 1 w 2 ⋮ w m ⎦ ⎤
their outer product or Kronecker product is given by the n × m n \times m n × m matrix
v ⊗ w = [ v 1 w 1 v 1 w 2 ⋯ v 1 w m v 2 w 1 v 2 w 2 ⋯ v 2 w m ⋮ ⋮ ⋱ ⋮ v n w 1 v n w 2 ⋯ v n w m ] \mathbf{v} \otimes \mathbf{w} = \begin{bmatrix} v_1 w_1 && v_1 w_2 && \cdots && v_1 w_m \\ v_2 w_1 && v_2 w_2 && \cdots && v_2 w_m \\ \vdots && \vdots && \ddots && \vdots \\ v_n w_1 && v_n w_2 && \cdots && v_n w_m\end{bmatrix} v ⊗ w = ⎣ ⎡ v 1 w 1 v 2 w 1 ⋮ v n w 1 v 1 w 2 v 2 w 2 ⋮ v n w 2 ⋯ ⋯ ⋱ ⋯ v 1 w m v 2 w m ⋮ v n w m ⎦ ⎤ 进一步地, 对于 2 × 2 2 \times 2 2 × 2 矩阵 A A A 和 3 × 2 3 \times 2 3 × 2 矩阵 B B B 他们的Kronecker Product是6 × 4 6 \times 4 6 × 4 矩阵:
A ⊗ B = [ a 11 B a 12 B a 21 B a 22 B ] = [ a 11 b 11 a 11 b 12 a 12 b 11 a 12 b 12 a 11 b 21 a 11 b 22 a 12 b 21 a 12 b 22 a 11 b 31 a 11 b 32 a 12 b 31 a 12 b 32 a 21 b 11 a 21 b 12 a 22 b 11 a 22 b 12 a 21 b 21 a 21 b 22 a 22 b 21 a 22 b 22 a 21 b 31 a 21 b 32 a 22 b 31 a 22 b 32 ]
\begin{aligned}
\mathrm{A} \otimes \mathrm{B} &=\left[\begin{array}{lll}
a_{11} \mathrm{~B} & a_{12} \mathrm{~B} \\ a_{21} \mathrm{~B} & a_{22} \mathrm{~B}
\end{array}\right] \\ &=\left[\begin{array}{llll}
a_{11} b_{11} & a_{11} b_{12} & a_{12} b_{11} & a_{12} b_{12} \\ a_{11} b_{21} & a_{11} b_{22} & a_{12} b_{21} & a_{12} b_{22} \\ a_{11} b_{31} & a_{11} b_{32} & a_{12} b_{31} & a_{12} b_{32} \\ a_{21} b_{11} & a_{21} b_{12} & a_{22} b_{11} & a_{22} b_{12} \\ a_{21} b_{21} & a_{21} b_{22} & a_{22} b_{21} & a_{22} b_{22} \\ a_{21} b_{31} & a_{21} b_{32} & a_{22} b_{31} & a_{22} b_{32}
\end{array}\right]
\end{aligned}
A ⊗ B = [ a 11 B a 21 B a 12 B a 22 B ] = ⎣ ⎡ a 11 b 11 a 11 b 21 a 11 b 31 a 21 b 11 a 21 b 21 a 21 b 31 a 11 b 12 a 11 b 22 a 11 b 32 a 21 b 12 a 21 b 22 a 21 b 32 a 12 b 11 a 12 b 21 a 12 b 31 a 22 b 11 a 22 b 21 a 22 b 31 a 12 b 12 a 12 b 22 a 12 b 32 a 22 b 12 a 22 b 22 a 22 b 32 ⎦ ⎤ Tensors for Beginners 13: Tensor Product vs Kronecker Product - YouTube