Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVM E值得更新 #9

Closed
lsabrinax opened this issue May 3, 2020 · 1 comment
Closed

SVM E值得更新 #9

lsabrinax opened this issue May 3, 2020 · 1 comment

Comments

@lsabrinax
Copy link

self.alpha[i] = alphaNew_1
self.alpha[j] = alphaNew_2
self.b = bNew

self.E[i] = self.calcEi(i)
self.E[j] = self.calcEi(j)

在每次更新完alpha1和alpha2之后,我认为应该更新所有的E值,因为alpha1和alpha2的不仅影响Ej和Ej,其他的也会受影响,下一次更新时用到的E1和E2应该是用最近一次更新之后的alpha计算的

@Dod-o
Copy link
Owner

Dod-o commented May 23, 2020

明白了你的意思,实际代码应该按你的想法去写,不过这样子时间复杂度上需要再乘上一个n的平方,也许会被无法接受。
实际上目前E的值像进度条一样更新,当前位置i的E是刚更新的,最可靠的,离当前位置i越远越不可靠,但随着迭代轮数的增加,整个模型会趋于稳定,每次更新alpha后对E的影响也就越来越小。
这是对时间的一种折中,我相信按照你说的做法实际迭代所需轮数可能会小一点,但多走几个轮数,让模型自己趋于稳定也一样可以,虽然轮数增加了,但我相信总时间会少很多很多。

@Dod-o Dod-o closed this as completed May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants