-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
关于第二章感知机的代码 #75
Comments
@zhaoxinjie |
哇,原来如此,百思不得其解,被你一语道破,太谢谢了! |
@zhaoxinjie if wx * yy_ > 0:
correct_count += 1
if correct_count > self.max_iter_:
logger.info(correct_count)
break
continue
self.w += self.eta_ * yy_ * xx_
n_iter_ += 1 这里面用了continue会跳过后面的n_iter_累加,所以又加了correct_count来判 if wx * yy_ <= 0:
self.w += self.eta_ * yy_ * xx_
n_iter_ += 1 不知道这样是不是可接受。 大多数算法都用到wx+b,刷参数,无论刷出来是否高效,最后可能都能用。这个就是算法有意思的地方吧。 |
其实这个也有点问题,是不是? 相当于有一个方向调整的学习率要大一些。 |
相关章节
CH02
相关主题
想知道 1.yy_ 为什么不是直接取的类别的值,而是乘以2-1,2.按照算法2.1理解,终止条件应该是没有误分类点或者迭代到最大次数,这里用准确次数大于迭代次数合适吗
The text was updated successfully, but these errors were encountered: