在数学和机器学习中,向量之间的运算有多种形式,主要包括内积(点积)、外积(叉积)、哈达玛积(逐元素积)、张量积(Kronecker积) 等。以下是它们的定义、写法、几何意义和使用场景。
1. 内积(Dot Product / Inner Product)
定义与写法
- 标准定义:两个向量 $\mathbf{a} = (a_1, a_2, \dots, a_n)$ 和 $\mathbf{b} = (b_1, b_2, \dots, b_n)$ 的内积为:
$$ \langle \mathbf{a}, \mathbf{b} \rangle = \mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^n a_i b_i $$
- 复数表示(二维情况):
$$ \mathbf{a} \cdot \mathbf{b} = \text{Re}(\mathbf{a} \mathbf{b}^) $$ 其中 $\mathbf{b}^$ 是共轭复数。
几何意义
- 衡量两个向量的相似度:
- 如果 $\mathbf{a} \cdot \mathbf{b} > 0$,夹角 $\theta < 90^\circ$(方向相近)。
- 如果 $\mathbf{a} \cdot \mathbf{b} = 0$,夹角 $\theta = 90^\circ$(正交)。
- 如果 $\mathbf{a} \cdot \mathbf{b} < 0$,夹
张芷铭的个人博客
Comments