<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.cslt.org/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn">
		<id>http://www.cslt.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13</id>
		<title>教学参考-13 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://www.cslt.org/mediawiki/index.php?action=history&amp;feed=atom&amp;title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13"/>
		<link rel="alternate" type="text/html" href="http://www.cslt.org/mediawiki/index.php?title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13&amp;action=history"/>
		<updated>2026-04-04T13:00:44Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>http://www.cslt.org/mediawiki/index.php?title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13&amp;diff=38825&amp;oldid=prev</id>
		<title>2022年8月3日 (三) 08:16 Cslt</title>
		<link rel="alternate" type="text/html" href="http://www.cslt.org/mediawiki/index.php?title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13&amp;diff=38825&amp;oldid=prev"/>
				<updated>2022-08-03T08:16:07Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2022年8月3日 (三) 08:16的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==教学目标==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==教学目标==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;理解机器学习系统构造的基本流程：模型设计-训练-测试-选择&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;理解监督学习、无监督学习、强化学习三种学习方法的基本概念&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;解流程中每一步的基本原则和基本方法&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;理解每种学习方法适用场景和要解决的任务&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 了解数据对机器学习的重要性以及过度依赖数据的风险&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==教学内容==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==教学内容==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;模型设计&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;监督学习&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;没有免费的午餐： 机器学习里有很多种模型，每种模型都有其适用范围，没有哪一种模型在所有场景下都优于其他模型。这一结论在机器学习里是一条可严格证明的定理，称为“没有免费的午餐”定理。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;监督学习类似于老师教学生，把知识直接传授给学生，学生记住了老师讲解的知识，即可用于实践。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;机器学习实践中很重要的一点是深入理解任务场景，设计与场景匹配的模型。模型设计合理，可以极大提高学习效率，改善模型的性能。机器学习很大程度上是一种权衡的艺术&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;监督学习可处理分类和回归两种任务，前者对样本的某种属性进行预测（因此也称为预测任务），后者对样本所属类别进行区分。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;在模型设计中，需要考虑的因素包括：数据的格式和数据量，数据的分布形式，训练过程的内存和计算开销，可容忍的错误率，运行时的硬件能力、外部环境干扰等。在设计型时需要对这些因素综合考虑，得到最合适的建模方案。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;举例：假设我们的目的是让机器学习什么是苹果。首先给它一些苹果的样例（数据），然后告诉它这些是苹果（标注）。用这些苹果的样例训练一个模型。当下次再有新的苹果出现时，机器就能认出它是个苹果了。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;* 监督学习需要对数据进行标注。依任务不同，标注的困难程度也不同。一般来说，标注会消耗大量人工和时间成本，但这些标注通常会带来性能的显著提升。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;模型训练&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;无监督学习&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;设计好了模型之后即需要对它进行学习，这一过程称为模型训练。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;无监督学习类似于没有老师的“自学成材” 。例如，如果给一个小学生一些水果，但并不告诉它哪个果子是苹果，哪个果子是香蕉。尽管如此，他依然可以发现很多事情，如把长的一样的果子归成一类，发现某类果子差异性更大，发现某两种果子更加相似，等等。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;模型训练的基础方法：首先将学习目标定义成合理的数学形式，这一数学形式称为目标函数。目标函数的参数即是模型的参数。选择一个数据集（称为训练集），利用合理的优化方法来调整模型参数，使得目标函数在该训练集上的取值最大，即完成了模型训练过程。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;机器也可以做到类似的事情，即通过数据本身发现其内部规律。这种学习方法称为无监督学习。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[文件:Apple-orange.png]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;聚类和流形学习是两类典型的无监督学习任务。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 以区分苹果-桔子的学习任务来举例说明。我们设计一个简单的模型： Y = a&amp;#160; ✖ C + b ✖ S ，其中C代表颜色，S代表大小，（a,b）为待学习的模型参数。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;聚类是指把相似的样本聚成一组，同组成员有相似的属性。例如，通过关察不同果子的特点，可以很容易把苹果、桃子、香蕉区分成不同组。这一方法可用于商品推荐：通过对商品进行聚类，可以给用户推荐与购买历史相似的商品。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;收集一个训练集，集中包含若干桔子和苹果的样例，每个样例表示成（C，S，T）的形式，其中T代表水果的真实类别，T=0时代表桔子，T=1时代表苹果。我们希望Y与T越接近越好，这样就可以用Y来预测T。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;流形学习是指通过观察发现样本的分布规律。例如，机器通过学习可以发现代表“颜色”这一属性的特征。有了这一发现，就可以通过在该特征上进行搜索来找到某种颜色的苹果样本。流形学习一般用于从数据中发现重要特征并对数据进行降维。一般来说机器学习中数据的维度都比较高降维后可以降低建模的难度。另外，如果把数据降到二维或三维，就可以直接观察数据的分布了，有利于分析数据特性，理解预测结果。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;设计一个目标函数 L=||Y-T||2。显然，L越小，说明Y和T越接近，模型越精确。因此，模型训练任务可以转化成目标函数L的最小化任务，即通过选择参数（a,b），使训练集中所有样本上计算得到L之和最小。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;对目标函数求最小值可以有多种方法。右图展示了一种逐渐优化的训练过程：首先对（a,b）随机取值，然后在这一取值附近随机选择一组新的取值，如果目标函数没有增长，则丢掉该参数值，否则予以保留。这一过程重复进行，如（A） -（D）所示。经过若干次尝试后，桔子-苹果的分类面就会变得越来越准确。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;强化学习&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;优化方法：梯度下降算法&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;我们想训练一条狗狗，当说“苹果”或“香焦”时，它可以把正确的水果送过来。狗狗本身确实可以分辨苹果和香蕉的不同，但它并不能把主人的发音与水果对应起来。因此我们需要一些监督信息，告诉狗狗不同水果的名字。可惜的是，狗狗听不懂我们说话，监督学习无法进行。怎么办呢？一种做法是用奖励信号代替监督信号来引导它主动学习。方法如下：如果它拿对了，就给它一块骨头做奖励；如果拿错了，就没有奖励。久而久之，它就可以听懂主人的命令了。这是一种有别于监督学习和非监督学习的学习方法，称为强化学习。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;强化学习是我们人的基础学习方法。想想我们小时候是如何学会走路的：父母并没有告诉我们应该先迈哪只脚，该如何用力等（小孩子也听不懂），但我们做好的时候会有成就感，还会得到父母的赞扬，如果做不好，摔跤了会感到疼痛。这样一正一负两种反馈就形成了学习信号，引导我们一点点学会走路。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;定义好目标函数以后，机器学习任务很大程度上转化成对目标函数L(W)的最小化任务，其中W代表模型的参数。前面我们已经提到了基于随机尝试的优化方法，但这种方法效率不高。为了更有效地完成这一优化任务，研究者提出了很多高质量的优化方法。在这些方法中，梯度下降法因其简单高效应用最为广泛。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;强化学习是一种间接的监督学习，通过奖励让机器知道应该如何行动。强化学习广泛应用在棋牌游戏、机器人动作等任务。在这些任务中，即时的监督信号很难获得，但可以通过行为产生的后果对模型进行引导，使得行为产生的整体收益最大。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;如果把W想象成位置座标，L(W)的值想象成山的高度，对L(W)最小化等价于寻找到一个最深的山谷。如果函数L(W）形式比较简单，可以直接推导出使L(W)最小的W。例如，如果L=W2,则W=0即是最小值点。在实际应用中，L(W）通常很复杂，难以通过计算直接得到。这时，一般采用多步迭代算法，逐渐接近最小值。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;AlphaGo&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;AlphaStar等系统都是基于强化学习训练的，因为人们不可能在每一步棋中告诉机器该怎么落子，也不可能在游戏过程中全程告诉机器该如何打。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;想象一个人在山坡的某一个位置，他的目的是下到最低谷，怎么办呢？通常的方案是从当前位置开始向四周探索一下，然后选择一个坡度最陡、下降最快的方向迈出一步。这样一步一步走下去，就可以逐渐接近谷底。这种方法通常称为下山法（有时也叫爬山法，对应L(W)的最大化）。数学上，坡度最陡的方向称为“梯度方向”，因此这一方法也称为梯度下降法。原则上，只要我们能计算出L(W)的梯度，就可以按梯度下降法寻找到一个优化的解W。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===梯度下降算法的改进===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;梯度下降法简单高效，但也存在一些问题。例如，当L(W)比较复杂时，往往呈现多个低谷，应用梯度下降法只能到达其中的某一个低谷，W的初始值不同，到达的低谷也不同。因此，算法并不能保证到达的低谷是最低的。为了解决这一问题，研究者提出一种称为模拟退火的算法，允许在下坡的时候偶尔往上坡方向也走一走，这样就可能跳出当前的低谷，到达更深的低谷。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 梯度下降法的另一种改进是考虑山坡的起伏程度来改变前进的步长。直观上，如果山坡是弯弯曲曲的，视野不好，这时步子就要迈的小一点，否则容易错过进入山谷的机会；反之，如果山坡很平坦，哪怕坡度很大，也可以放心大胆地迈远一点，这样下山的速度会更快一些。山坡的起伏程度在数学上称为曲率，考率曲率的优化方法一般称为牛顿法。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 除了上面这些改进，研究者们还提出了在每一步优化时随机选择训练样本子集的小批量随机梯度下降算法，研究了在参数更新时考虑前一时刻梯度的动量算法等。这些方法已经成为机器学习里的标准方法，广泛应用在各种模型的训练任务中。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===模型测试===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 模型训练完成以后，需要对其性能进行测试。对模型的测试应该基于一个独立的测试集。为什么要在一个新的数据集上进行性能测试呢？这是因为模型在训练集和测试集上的性能可能存在很大差异：在训练集上性能非常好的模型，在测试集上可能会差很多。这是因为如果模型的参数和训练集中的数据过度适应，可能导致在其他数据集上性能下降。这种现象称为“过拟合”。这就如同一个只会死记硬背的学生，在课堂学习时把老师讲的所有题目都死记硬背下来，但是在考试时肯定会遇到没见过的题目，这时就做不出来了。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 在系统测试时，我们当然更加关注它在未知数据上的表现。这是因为在实际应用中遇到的数据绝大多数是在训练集中没有出现过的未知数据。为了获知在机器学习系统的真实性能，我们需要一个独立测试集来进行性能测试。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 过拟合现象的根本原因在于模型记住了数据中的细枝末节，并把这些细枝末节错误地当成了规律。然而，这些规律其实并不存在，从而导致在未知数据上的性能下降。一般来说，越复杂的模型发生过拟合的可能性越大。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 如下图所示，一条曲线比直线在训练集上的性能更好，但发生过拟合的可能性也更大。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[文件:Apple-orange-overfit.png]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===模型选择===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 过拟合现象的存在使得模型选择变得非常重要。复杂的模型有更强大的学习能力，同时也会带来更严重的过拟合问题，导致在实际运行时性能下降。特别是当训练数据较少时，这种过拟合更为严重。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 如何选择合适的模型呢？机器学习里有一条著名的原则：如果两个模型具有类似的性能，那么应该选择更简单的那个。这条原则称为“奥卡姆剃刀准则（Occam’s Razor）”。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 奥卡姆是个人名，英国中世纪哲学家。奥卡姆剃刀是比喻用法，意思是“删掉不必要的复杂性”。基于奥卡姆剃刀准则，在测试集上性能相近的前提下，应尽量选择那些简单的模型。例如，如果用线性模型可以解决问题，就不要选择更复杂的非线性模型；如果用10个参数的模型可以解决问题，就不要用100个参数的模型。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 所谓线性模型，是指模型的输入和输出具有线性相加关系的模型，如 y = ax1 + bx2 + cx3， 其中(x1&lt;/del&gt;,&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;x2,x3)为输入变量，y为输出，y是由x1,x2,x3线性相加而得到。之所叫线性模型，是因为如果将任意一个输入（比如x1)和 y 分别作为 x轴和y轴，画出y(x)的函数，可以看到是一条直线。非线性模型是不具有这种线性关系的模型。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===训练数据===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 机器学习建模的各个步骤都离不开数据。首先，在模型设计时就需要考虑数据本身的特点，包括数据形式、分布规律、训练数据数量和质量等；在模型训练时，训练算法的目的是优化目标函数在训练数据上的取值；在模型测试时，要基于测试数据来验证系统性能；在模型选择时，依然需要考虑训练数据与实际场景匹配度，选择具有合理复杂度的模型。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 训练数据要保证一定的数量。越复杂的模型，需要的数据量越大，否则容易发生过拟合。以当前流行的深度学习模型为例，学习一个实用的语音识别系统，往往需要上万小时的语音数据。著名的GPT-3预训练语言模型则使用了数千亿单词，这些数据占据的磁盘空间达45TB。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 训练数据要保证合理的质量。目前大部分系统依赖的还是人工筛选和标注的数据，以保证数据的质量。如在语音识别任务中需要标记发音内容，图像分割任务中需要标注物体边界，人脸识别任务中需要标注人的身份。这些数据质量较高，但筛选和标注都要耗费大量人力成本。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 训练数据需要有代表性。一般来说，如果我们的目的是研究模型在特定条件下的系统行为，如光照对人脸识别的影响，可以采用实验室条件下收集的数据，以突出目标因素的影响；如果目的是构造一个实用系统，则最好使用实地采集的数据，以满足实际应用场景的需要。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;===数据依赖的风险===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* “吃进去的是数据，得到的是智能”。通过从数据中总结规律，机器学习可以获得强大的智能。从这个角度上说，数据是人工智能的粮食。然而，过度的数据依赖可能带来很多负面影响。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 首先数据标注需要大量人力成本和时间成本，给构建机器学习系统带来现实压力；第二，数据本身存在不均衡性，大量数据是常见的、容易获得的数据，那些不常见的、难以获得的数据较少。数据不均衡带来模型上的偏差，不仅难以处理重要的但频率不高的事件，还可能带来不公平性（如对某一肤色人种识别性能的下降）；第三，从数据中总结出来的知识是隐性的，可能带来不可预期的系统行为。例如，文本数据中可能包含带有偏见的句子，基于这样的数据可能训练出具有同样偏见的对话机器人。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* 目前，研究者正在探索减小数据依赖的方法，典型的如数据增强、模型预训练、迁移学习等。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cslt</name></author>	</entry>

	<entry>
		<id>http://www.cslt.org/mediawiki/index.php?title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13&amp;diff=38824&amp;oldid=prev</id>
		<title>Cslt：以“==教学目标==  * 理解机器学习系统构造的基本流程：模型设计-训练-测试-选择 * 解流程中每一步的基本原则和基本方法 * 了解...”为内容创建页面</title>
		<link rel="alternate" type="text/html" href="http://www.cslt.org/mediawiki/index.php?title=%E6%95%99%E5%AD%A6%E5%8F%82%E8%80%83-13&amp;diff=38824&amp;oldid=prev"/>
				<updated>2022-08-03T07:54:51Z</updated>
		
		<summary type="html">&lt;p&gt;以“==教学目标==  * 理解机器学习系统构造的基本流程：模型设计-训练-测试-选择 * 解流程中每一步的基本原则和基本方法 * 了解...”为内容创建页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==教学目标==&lt;br /&gt;
&lt;br /&gt;
* 理解机器学习系统构造的基本流程：模型设计-训练-测试-选择&lt;br /&gt;
* 解流程中每一步的基本原则和基本方法&lt;br /&gt;
* 了解数据对机器学习的重要性以及过度依赖数据的风险&lt;br /&gt;
&lt;br /&gt;
==教学内容==&lt;br /&gt;
&lt;br /&gt;
===模型设计===&lt;br /&gt;
&lt;br /&gt;
* 没有免费的午餐： 机器学习里有很多种模型，每种模型都有其适用范围，没有哪一种模型在所有场景下都优于其他模型。这一结论在机器学习里是一条可严格证明的定理，称为“没有免费的午餐”定理。&lt;br /&gt;
* 机器学习实践中很重要的一点是深入理解任务场景，设计与场景匹配的模型。模型设计合理，可以极大提高学习效率，改善模型的性能。机器学习很大程度上是一种权衡的艺术&lt;br /&gt;
* 在模型设计中，需要考虑的因素包括：数据的格式和数据量，数据的分布形式，训练过程的内存和计算开销，可容忍的错误率，运行时的硬件能力、外部环境干扰等。在设计型时需要对这些因素综合考虑，得到最合适的建模方案。&lt;br /&gt;
&lt;br /&gt;
===模型训练===&lt;br /&gt;
&lt;br /&gt;
* 设计好了模型之后即需要对它进行学习，这一过程称为模型训练。&lt;br /&gt;
* 模型训练的基础方法：首先将学习目标定义成合理的数学形式，这一数学形式称为目标函数。目标函数的参数即是模型的参数。选择一个数据集（称为训练集），利用合理的优化方法来调整模型参数，使得目标函数在该训练集上的取值最大，即完成了模型训练过程。&lt;br /&gt;
[[文件:Apple-orange.png]]&lt;br /&gt;
* 以区分苹果-桔子的学习任务来举例说明。我们设计一个简单的模型： Y = a  ✖ C + b ✖ S ，其中C代表颜色，S代表大小，（a,b）为待学习的模型参数。&lt;br /&gt;
* 收集一个训练集，集中包含若干桔子和苹果的样例，每个样例表示成（C，S，T）的形式，其中T代表水果的真实类别，T=0时代表桔子，T=1时代表苹果。我们希望Y与T越接近越好，这样就可以用Y来预测T。&lt;br /&gt;
* 设计一个目标函数 L=||Y-T||2。显然，L越小，说明Y和T越接近，模型越精确。因此，模型训练任务可以转化成目标函数L的最小化任务，即通过选择参数（a,b），使训练集中所有样本上计算得到L之和最小。&lt;br /&gt;
* 对目标函数求最小值可以有多种方法。右图展示了一种逐渐优化的训练过程：首先对（a,b）随机取值，然后在这一取值附近随机选择一组新的取值，如果目标函数没有增长，则丢掉该参数值，否则予以保留。这一过程重复进行，如（A） -（D）所示。经过若干次尝试后，桔子-苹果的分类面就会变得越来越准确。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===优化方法：梯度下降算法===&lt;br /&gt;
&lt;br /&gt;
* 定义好目标函数以后，机器学习任务很大程度上转化成对目标函数L(W)的最小化任务，其中W代表模型的参数。前面我们已经提到了基于随机尝试的优化方法，但这种方法效率不高。为了更有效地完成这一优化任务，研究者提出了很多高质量的优化方法。在这些方法中，梯度下降法因其简单高效应用最为广泛。&lt;br /&gt;
* 如果把W想象成位置座标，L(W)的值想象成山的高度，对L(W)最小化等价于寻找到一个最深的山谷。如果函数L(W）形式比较简单，可以直接推导出使L(W)最小的W。例如，如果L=W2,则W=0即是最小值点。在实际应用中，L(W）通常很复杂，难以通过计算直接得到。这时，一般采用多步迭代算法，逐渐接近最小值。&lt;br /&gt;
* 想象一个人在山坡的某一个位置，他的目的是下到最低谷，怎么办呢？通常的方案是从当前位置开始向四周探索一下，然后选择一个坡度最陡、下降最快的方向迈出一步。这样一步一步走下去，就可以逐渐接近谷底。这种方法通常称为下山法（有时也叫爬山法，对应L(W)的最大化）。数学上，坡度最陡的方向称为“梯度方向”，因此这一方法也称为梯度下降法。原则上，只要我们能计算出L(W)的梯度，就可以按梯度下降法寻找到一个优化的解W。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===梯度下降算法的改进===&lt;br /&gt;
&lt;br /&gt;
* 梯度下降法简单高效，但也存在一些问题。例如，当L(W)比较复杂时，往往呈现多个低谷，应用梯度下降法只能到达其中的某一个低谷，W的初始值不同，到达的低谷也不同。因此，算法并不能保证到达的低谷是最低的。为了解决这一问题，研究者提出一种称为模拟退火的算法，允许在下坡的时候偶尔往上坡方向也走一走，这样就可能跳出当前的低谷，到达更深的低谷。&lt;br /&gt;
* 梯度下降法的另一种改进是考虑山坡的起伏程度来改变前进的步长。直观上，如果山坡是弯弯曲曲的，视野不好，这时步子就要迈的小一点，否则容易错过进入山谷的机会；反之，如果山坡很平坦，哪怕坡度很大，也可以放心大胆地迈远一点，这样下山的速度会更快一些。山坡的起伏程度在数学上称为曲率，考率曲率的优化方法一般称为牛顿法。&lt;br /&gt;
* 除了上面这些改进，研究者们还提出了在每一步优化时随机选择训练样本子集的小批量随机梯度下降算法，研究了在参数更新时考虑前一时刻梯度的动量算法等。这些方法已经成为机器学习里的标准方法，广泛应用在各种模型的训练任务中。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===模型测试===&lt;br /&gt;
&lt;br /&gt;
* 模型训练完成以后，需要对其性能进行测试。对模型的测试应该基于一个独立的测试集。为什么要在一个新的数据集上进行性能测试呢？这是因为模型在训练集和测试集上的性能可能存在很大差异：在训练集上性能非常好的模型，在测试集上可能会差很多。这是因为如果模型的参数和训练集中的数据过度适应，可能导致在其他数据集上性能下降。这种现象称为“过拟合”。这就如同一个只会死记硬背的学生，在课堂学习时把老师讲的所有题目都死记硬背下来，但是在考试时肯定会遇到没见过的题目，这时就做不出来了。&lt;br /&gt;
* 在系统测试时，我们当然更加关注它在未知数据上的表现。这是因为在实际应用中遇到的数据绝大多数是在训练集中没有出现过的未知数据。为了获知在机器学习系统的真实性能，我们需要一个独立测试集来进行性能测试。&lt;br /&gt;
* 过拟合现象的根本原因在于模型记住了数据中的细枝末节，并把这些细枝末节错误地当成了规律。然而，这些规律其实并不存在，从而导致在未知数据上的性能下降。一般来说，越复杂的模型发生过拟合的可能性越大。&lt;br /&gt;
* 如下图所示，一条曲线比直线在训练集上的性能更好，但发生过拟合的可能性也更大。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[文件:Apple-orange-overfit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===模型选择===&lt;br /&gt;
* 过拟合现象的存在使得模型选择变得非常重要。复杂的模型有更强大的学习能力，同时也会带来更严重的过拟合问题，导致在实际运行时性能下降。特别是当训练数据较少时，这种过拟合更为严重。&lt;br /&gt;
* 如何选择合适的模型呢？机器学习里有一条著名的原则：如果两个模型具有类似的性能，那么应该选择更简单的那个。这条原则称为“奥卡姆剃刀准则（Occam’s Razor）”。&lt;br /&gt;
* 奥卡姆是个人名，英国中世纪哲学家。奥卡姆剃刀是比喻用法，意思是“删掉不必要的复杂性”。基于奥卡姆剃刀准则，在测试集上性能相近的前提下，应尽量选择那些简单的模型。例如，如果用线性模型可以解决问题，就不要选择更复杂的非线性模型；如果用10个参数的模型可以解决问题，就不要用100个参数的模型。&lt;br /&gt;
* 所谓线性模型，是指模型的输入和输出具有线性相加关系的模型，如 y = ax1 + bx2 + cx3， 其中(x1,x2,x3)为输入变量，y为输出，y是由x1,x2,x3线性相加而得到。之所叫线性模型，是因为如果将任意一个输入（比如x1)和 y 分别作为 x轴和y轴，画出y(x)的函数，可以看到是一条直线。非线性模型是不具有这种线性关系的模型。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===训练数据===&lt;br /&gt;
&lt;br /&gt;
* 机器学习建模的各个步骤都离不开数据。首先，在模型设计时就需要考虑数据本身的特点，包括数据形式、分布规律、训练数据数量和质量等；在模型训练时，训练算法的目的是优化目标函数在训练数据上的取值；在模型测试时，要基于测试数据来验证系统性能；在模型选择时，依然需要考虑训练数据与实际场景匹配度，选择具有合理复杂度的模型。&lt;br /&gt;
* 训练数据要保证一定的数量。越复杂的模型，需要的数据量越大，否则容易发生过拟合。以当前流行的深度学习模型为例，学习一个实用的语音识别系统，往往需要上万小时的语音数据。著名的GPT-3预训练语言模型则使用了数千亿单词，这些数据占据的磁盘空间达45TB。&lt;br /&gt;
* 训练数据要保证合理的质量。目前大部分系统依赖的还是人工筛选和标注的数据，以保证数据的质量。如在语音识别任务中需要标记发音内容，图像分割任务中需要标注物体边界，人脸识别任务中需要标注人的身份。这些数据质量较高，但筛选和标注都要耗费大量人力成本。&lt;br /&gt;
* 训练数据需要有代表性。一般来说，如果我们的目的是研究模型在特定条件下的系统行为，如光照对人脸识别的影响，可以采用实验室条件下收集的数据，以突出目标因素的影响；如果目的是构造一个实用系统，则最好使用实地采集的数据，以满足实际应用场景的需要。&lt;br /&gt;
&lt;br /&gt;
===数据依赖的风险===&lt;br /&gt;
* “吃进去的是数据，得到的是智能”。通过从数据中总结规律，机器学习可以获得强大的智能。从这个角度上说，数据是人工智能的粮食。然而，过度的数据依赖可能带来很多负面影响。&lt;br /&gt;
* 首先数据标注需要大量人力成本和时间成本，给构建机器学习系统带来现实压力；第二，数据本身存在不均衡性，大量数据是常见的、容易获得的数据，那些不常见的、难以获得的数据较少。数据不均衡带来模型上的偏差，不仅难以处理重要的但频率不高的事件，还可能带来不公平性（如对某一肤色人种识别性能的下降）；第三，从数据中总结出来的知识是隐性的，可能带来不可预期的系统行为。例如，文本数据中可能包含带有偏见的句子，基于这样的数据可能训练出具有同样偏见的对话机器人。&lt;br /&gt;
* 目前，研究者正在探索减小数据依赖的方法，典型的如数据增强、模型预训练、迁移学习等。&lt;/div&gt;</summary>
		<author><name>Cslt</name></author>	</entry>

	</feed>