线性核是正定的吗? [英] Is linear kernel positive definite?
问题描述
在很多文章中,线性核(两个矩阵的内积)被列为正定性,但是当我用玩具数据集尝试线性正核时,正定性测试将返回负结果.我检查了MATLAB SVM函数的线性核.
In a lot of articles, the linear kernel (inner product of two matrices) is listed as positive definite however when I try it with a toy dataset, positive definiteness test returns negative result. I checked the MATLAB SVM function for linear kernel.
线性核函数是一行命令,
The linear kernel function is one line command,
K=(u*v')
但是,在执行主svm_train函数的此步骤之后,它会使用K进行另一项操作,
However after this step in the main svm_train function it does another operation using K,
kx= (kx+kx')/2 + diag(1./boxconstraint)
其中kx
是K,diag(1./boxconstraint)
只是大小为kx
的对角矩阵,所得的kx
通过了正定性检验.作为对此步骤的解释,它说
'% ensure function is symmetric.'
我也检查了libsvm
,但在那儿找不到此附加操作.
Where kx
is K and diag(1./boxconstraint)
is just a diagonal matrix of size kx
and resultant kx
pass the positive definiteness test. As an explanation of this step it says
'% ensure function is symmetric.'
I also checked libsvm
but I could not find this additional operation there.
但是,内积已经是对称的,此步骤通常用于将不定矩阵转换为正定矩阵.我对内部乘积内核为什么不通过正定性测试感到困惑?
However the inner product is already symmetric and this step is usually used to turn indefinite matrices into positive definite matrices. I am a bit confused about why inner product kernel does not pass the positive definiteness test?
推荐答案
如果u,v都是行向量(即K计算为标量),则仅当K = dot(u,v)时,K才是正定的. 0.
If u,v are both row vectors (i.e. K evaluates to a scalar), K will only be positive definite if K=dot(u,v)>0.
如果u和v是更通用的矩阵(不是行向量)并且u〜= v,则K = u * v'通常不会对称,更不用说正定了.即使当u = v时,除非u具有完整的行级,否则K将是非负定数,但不会严格地是正定数.但是,假设所有boxconstraint(i)> 0,则附加矩阵1./diag(boxconstraint)严格为正定.将非负定矩阵加到严格正定矩阵上,总是会得到严格正定结果.
If u and v are more general matrices (not row vectors) and u~=v, then K=u*v' will not generally be symmetric, let alone positive definite. Even when u=v, K will be non-negative definite, but will not be strictly positive definite unless u has full row rank. However, the additional matrix 1./diag(boxconstraint) is strictly positive definite assuming all boxconstraint(i)>0. Adding a non-negative definite matrix to a strictly positive definite matrix produces a strictly positive definite result always.
这篇关于线性核是正定的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!