SVM中第342行 calcSinglKernel函数是不是多计算了一遍exp
hao14293 opened this issue · comments
hao14293 commented
def calcSinglKernel(self, x1, x2):
'''
单独计算核函数
:param x1: 向量1
:param x2: 向量2
:return: 核函数结果
'''
# 7.90
result = (x1 - x2) * (x1 - x2).T
result = np.exp(-1 * result / (2 * self.sigma ** 2))
return result
Dod-o commented
确实,会在近期修改,感谢~