Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
108
第 4 章
训练模型
到目前为止,我们已经探讨了不同机器学习的模型,但是它们各自的训练算法在很大程
度上还是一个黑匣子。回顾前几章里的部分案例,你大概感到非常惊讶,在对系统内部
一无所知的情况下,居然已经实现了这么多:优化了一个回归系统,改进了一个数字图
片分类器,从零开始构建了一个垃圾邮件分类器,所有这些,你都不知道它们实际是如
何工作的。确实是这样,在许多情况下,你并不需要了解实施细节。
但是,很好地理解系统如何工作也是非常有帮助的。针对你的任务,它有助于快速定位
到合适的模型、正确的训练算法,以及一套适当的超参数。不仅如此,后期还能让你
更高效地执行错误调试和错误分析。最后还要强调一点,本章探讨的大部分主题对于理
解、构建和训练神经网络(本书第二部分)是至关重要的。
本章我们将从最简单的模型之一
—
线性回归模型,开始介绍两种非常不同的训练模型
的方法:
•
通过“闭式”方程,直接计算出最拟合训练集的模型参数(也就是使训练集上的成
本函数最小化的模型参数)。
•
使用迭代优化的方法,即梯度下降(GD),逐渐调整模型参数直至训练集上的成本
函数调至最低,最终趋同于第一种方法计算出来的模型参数。我们还会研究几个梯
度下降的变体,包括批量梯度下降、小批量梯度下降以及随机梯度下降。等我们进
入到第二部分神经网络的学习时,会频繁地使用这几个的变体。
接着我们将会进入多项式回归的讨论,这是一个更为复杂的模型,更适合非线性数据
集。由于该模型的参数比线性模型更多,因此更容易造成对训练数据过拟合,我们将使
用学习曲线来分辨这种情况是否发生。然后 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977