赞
踩
向量的点乘,也叫向量的内积、数量积。结果是一个向量在另一个向量方向上投影的长度,是一个标量。
对于向量 a a a和 b b b, A = [ a 1 , a 2 , … a n ] A=\left[a_{1}, a_{2}, \ldots a_{n}\right] \quad A=[a1,a2,…an], B = [ b 1 , b 2 , … b n ] B=\left[b_{1}, b_{2}, \ldots b_{n}\right] \quad B=[b1,b2,…bn]
A
⋅
B
=
∑
a
i
b
i
\mathrm{A} \cdot \mathbf{B}=\sum a_{i} b_{i}
A⋅B=∑aibi
或者:
A
⋅
B
=
∣
A
∥
B
∣
cos
θ
\mathbf{A} \cdot \mathbf{B}=|\mathbf{A} \| \mathbf{B}| \cos \theta
A⋅B=∣A∥B∣cosθ
向量的叉乘,又叫向量积、外积、叉积。结果是一个和已有两个向量都垂直的向量。以三维向量为例
A
×
B
=
∣
i
j
k
a
1
a
2
a
3
b
1
b
2
b
3
∣
=
(
a
2
b
3
−
b
2
a
3
)
i
−
(
a
1
b
3
−
b
1
a
3
)
j
+
(
a
1
b
2
−
b
1
a
2
)
k
A\times B =\left|
其中: i = ( 1 , 0 , 0 ) j = ( 0 , 1 , 0 ) k = ( 0 , 0 , 1 ) i=(1,0,0) \quad \mathrm{j}=(0,1,0) \quad \mathrm{k}=(0,0,1) i=(1,0,0)j=(0,1,0)k=(0,0,1)
张量(矩阵)的点乘,又叫哈达马积(Hadamard product),矩阵对应位置的元素相乘
m × n m \times n m×n 矩阵 A = [ a i j ] A=\left[a_{i j}\right] A=[aij] 与 m × n m \times n m×n 矩阵 B = [ b i j ] B=\left[b_{i j}\right] B=[bij] 的Hadamard积记作 A ∗ B A * B A∗B 。
其元素定义为两个矩阵对应元素的乘积
(
A
∗
B
)
i
j
=
a
i
j
b
i
j
(A * B)_{i j}=a_{i j} b_{i j}
(A∗B)ij=aijbij ,例如
(
1
3
2
1
0
0
1
2
2
)
∗
(
0
0
2
7
5
0
2
1
1
)
=
(
1
⋅
0
3
⋅
0
2
⋅
2
1
⋅
7
0
⋅
5
0
⋅
0
1
⋅
2
2
⋅
1
2
⋅
1
)
=
(
0
0
4
7
0
0
2
2
2
)
\left(
克罗内克积是两个任意大小的矩阵间的运算,也叫直积或张量积。计算过程如下例所示:
(
1
2
3
1
)
⊗
(
0
3
2
1
)
=
(
1
⋅
0
1
⋅
3
2
⋅
0
2
⋅
3
1
⋅
2
1
⋅
1
2
⋅
2
2
⋅
1
3
⋅
0
3
⋅
3
1
⋅
0
1
⋅
3
3
⋅
2
3
⋅
1
1
⋅
2
1
⋅
1
)
=
(
0
3
0
6
2
1
4
2
0
9
0
3
6
3
2
1
)
\left(
张量(矩阵)的拼接可以按照不同的维度拼接
按照第一维度拼接:
(
1
2
3
1
)
⊕
(
0
3
2
1
)
=
(
1
2
0
3
3
1
2
1
)
\left(
按照第二维度拼接:
(
1
2
3
1
)
⊕
(
0
3
2
1
)
=
(
1
2
3
1
0
3
2
1
)
\left(
此外,数乘表示一个标量乘以一个矩阵或者向量中的每个元素
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。