Vectors, Matrices and Tensors 在papers中的常规约定

最近看KDD,NIPS很兴奋,可是一些基础notations来说wiki来回很费时间,遂稍作总结(refers to Bengio–Deep Learning-chapter2)

vectors(lowercase)

如果n维向量的每个元素属于 ,此向量为 的n阶笛卡尔乘积,表示为 n
x_{-1}表示向量x除去第一个元素的结果
x_{-S}表示向量x除去S集合中所有元素的结果

matrices(uppercase)

实矩阵表示方法: Am×n

转置(transpose),斜对角线翻转,表述为 A
论文里常用 x=[x1,x2,x3] 表示列向量

multiply

1.矩阵乘积 C=AB
2.element-wise product/Hadamard product 表示为 AB
3.dot product 表示为 ab ,结果为scalar,显然具有commutative性质
4. AB=(BA)
只谈论文常规表述,性质不细谈的说
5.一个基础notation, Ax=b ,称作Matrix-vector product
6.Inversion A1A=In
当A存在inversion时,可以利用这个条件近似很多问题,但实操很少用,因为精度有限(在解决问题5时),未满秩序时不止一个solution

order

  1. linear dependence 该向量不可被其他行向量线性表达
  2. 对于问题5有界的第二个sufficient condition是,A的linear dependence需要大于len(b)
    3.singular–奇异矩阵 为了使问题5有唯一解,使 Am×n 的m=n,st.(每一阶linear dependence)。满足此二条约束的矩阵为奇异矩阵.满足奇异矩阵,可用inversion解问题5

norms

null
Lpnorms
papers常用norms细致描述dot product以突出距离关系,比如:

xy=||x||2||y||2cosθ

others

1.Diagonal matrices(对角矩阵),identity matrix是diagonal的,呵呵
2. diag(v) 表示把v向量用Diagonal形式
3.对角矩阵是深度学习一个trick,因为计算方便,比如 vx=diag(v)x ,包括inverting等操作,对计算开销都是less expensive的
4.symmetric matrix 满足 A=A
5.unit vector(单位向量),满足单位范式 ||x||2=1
6.orthogonal 向量正交性质 xy=0
orthogonal matrix (正交矩阵)行相乘为0,列相乘为0
得到一个很重要方法 A1=A

decomposition

降维/推荐系统/特征抽取必备
1.eigendecomposition 特征值分解 Av=λv
其中分别为特征值,特征向量
2.Singular Value Decomposition 奇异值分解,即factorize这个A得到奇异值和奇异矩阵(注意与第一条对应)
3.Singular Value Decomposition比eigendecomposition更泛用,可以想象一下一个matrix分解为singular的可行性远大于eigen!(考虑矩阵非square的情形)
具体不表

Moore-Penrose Pseudoinverse

广义逆…最近老看到这玩意,

Trace Operator


一个矩阵的diagonal entries的sum
大规模机器学习上trace很有用

Determinant

行列式,notation为det(A),转为标量,
eigenvalues的所有乘积,此指标能感性判断矩阵的contracted的能力
即这个矩阵volume-preserving的程度.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Sure, here is the code to calculate inner, outer and cross products of vectors using NumPy: ```python import numpy as np # Define two vectors a = np.array([3,6]) b = np.array([9,10]) # Calculate inner product inner_product = np.inner(a, b) print("Inner product of vectors a and b =", inner_product) # Calculate outer product outer_product = np.outer(a, b) print("Outer product of vectors a and b =", outer_product) # Calculate cross product cross_product = np.cross(a, b) print("Cross product of vectors a and b =", cross_product) ``` And here is the output for the given sample data: ``` Inner product of vectors a and b = 87 Outer product of vectors a and b = [[27 30] [54 60]] Cross product of vectors a and b = -24 ``` To calculate inner, outer and cross products of matrices, you can use the same functions `np.inner()`, `np.outer()` and `np.cross()`, but you need to pass matrices as arguments instead of vectors. Here is an example: ```python import numpy as np # Define two matrices a = np.array([[1, 2], [3, 4]]) b = np.array([[5, 6], [7, 8]]) # Calculate inner product inner_product = np.inner(a, b) print("Inner product of matrices a and b =", inner_product) # Calculate outer product outer_product = np.outer(a, b) print("Outer product of matrices a and b =", outer_product) # Calculate cross product # Not applicable for matrices ``` And the output: ``` Inner product of matrices a and b = [[19 22] [43 50]] Outer product of matrices a and b = [[ 5 6 7 8] [10 12 14 16] [15 18 21 24] [20 24 28 32]] ``` Note that cross product is not applicable for matrices, because it is defined only for vectors in 3D space.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值