forked from lyhue1991/eat_tensorflow2_in_30_days
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
20 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 3-1,低阶API示范 | ||
|
||
|
||
|
||
下面的范例使用TensorFlow的低阶API实现线性回归模型。 | ||
|
||
低阶API主要包括张量操作,计算图和自动微分。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 3-2,中阶API示范 | ||
|
||
|
||
|
||
下面的范例使用TensorFlow的中阶API实现线性回归模型。 | ||
|
||
TensorFlow的中阶API主要包括各种模型层,损失函数,优化器,数据管道,特征列等等。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 3-3,高阶API示范 | ||
|
||
|
||
|
||
下面的范例使用TensorFlow的高阶API实现线性回归模型。 | ||
|
||
TensorFlow的高阶API主要为tf.keras.models提供的模型的类接口。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 4-2,张量的数学运算 | ||
|
||
|
||
|
||
张量的操作主要包括张量的结构操作和张量的数学运算。 | ||
|
||
张量结构操作诸如:张量创建,索引切片,维度变换,合并分割。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 4-3,AutoGraph的使用规范 | ||
|
||
|
||
|
||
有三种计算图的构建方式:静态计算图,动态计算图,以及Autograph。 | ||
|
||
TensorFlow 2.0主要使用的是动态计算图和Autograph。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 4-4,AutoGraph的机制原理 | ||
|
||
|
||
|
||
有三种计算图的构建方式:静态计算图,动态计算图,以及Autograph。 | ||
|
||
TensorFlow 2.0主要使用的是动态计算图和Autograph。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 5-2,特征列feature_column | ||
|
||
|
||
|
||
特征列 通常用于对结构化数据实施特征工程时候使用,图像或者文本数据一般不会用到特征列。 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 5-4,模型层layers | ||
|
||
|
||
|
||
深度学习模型一般由各种模型层组合而成。 | ||
|
||
tf.keras.layers内置了非常丰富的各种功能的模型层。例如, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 5-7,优化器optimizers | ||
|
||
|
||
|
||
机器学习界有一群炼丹师,他们每天的日常是: | ||
|
||
拿来药材(数据),架起八卦炉(模型),点着六味真火(优化算法),就摇着蒲扇等着丹药出炉了。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 6-2,训练模型的3种方法 | ||
|
||
|
||
|
||
模型的训练主要有内置fit方法、内置tran_on_batch方法、自定义训练循环。 | ||
|
||
注:fit_generator方法在tf.keras中不推荐使用,其功能已经被fit包含。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 6-4,使用多GPU训练模型 | ||
|
||
|
||
|
||
如果使用多GPU训练模型,推荐使用内置fit方法,较为方便,仅需添加2行代码。 | ||
|
||
在Colab笔记本中:修改->笔记本设置->硬件加速器 中选择 GPU | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 6-5,使用TPU训练模型 | ||
|
||
|
||
|
||
如果想尝试使用Google Colab上的TPU来训练模型,也是非常方便,仅需添加6行代码。 | ||
|
||
在Colab笔记本中:修改->笔记本设置->硬件加速器 中选择 TPU | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 五、TensorFlow的中阶API | ||
|
||
|
||
|
||
TensorFlow的中阶API主要包括: | ||
|
||
* 数据管道(tf.data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 六、TensorFlow的高阶API | ||
|
||
|
||
|
||
TensorFlow的高阶API主要是tensorflow.keras.models. | ||
|
||
本章我们主要详细介绍tensorflow.keras.models相关的以下内容。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# 四、TensorFlow的低阶API | ||
|
||
|
||
|
||
TensorFlow的低阶API主要包括张量操作,计算图和自动微分。 | ||
|
||
如果把模型比作一个房子,那么低阶API就是【模型之砖】。 | ||
|