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

感知机的梯度求导疑问 #37

Closed
xinghalo opened this issue Nov 15, 2018 · 1 comment
Closed

感知机的梯度求导疑问 #37

xinghalo opened this issue Nov 15, 2018 · 1 comment

Comments

@xinghalo
Copy link

好奇,再做梯度更新的时候,为什么梯度是label-output。
在《统计学习方法》里面,梯度更新的规则是 w = w + αyixi

def _update_weights(self, input_vec, output, label, rate):
        delta = label - output
        print("delta\t: %f" % delta)
        self.weights = [w + rate * delta * x for (x, w) in zip(input_vec, self.weights)]
        self.bias += rate * delta
        print(self)
@xinghalo
Copy link
Author

原来是公式推导简化而来的,看完第二篇,就明白了

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

1 participant