提交 328a0bf8 编写于 作者: W wizardforcel

2020-09-13 22:48:14

上级 8ed887ef
......@@ -35,27 +35,6 @@
为了充分利用本书,读者应该对 Python 编程语言以及如何安装一些必需的软件包有所了解。 本书将以简单的语言介绍所有其他内容。 安装说明将在本书和存储库中给出。
# 下载示例代码文件
您可以从 [www.packtpub.com](http://www.packtpub.com) 的帐户中下载本书的示例代码文件。 如果您在其他地方购买了此书,则可以访问 [www.packtpub.com/support](http://www.packtpub.com/support) 并注册以将文件直接通过电子邮件发送给您。
您可以按照以下步骤下载代码文件:
1. 登录或注册 [www.packtpub.com](http://www.packtpub.com/support)
2. 选择支持选项卡。
3. 单击代码下载和勘误。
4. 在搜索框中输入书籍的名称,然后按照屏幕上的说明进行操作。
下载文件后,请确保使用以下最新版本解压缩或解压缩文件夹:
* Windows 的 WinRAR / 7-Zip
* Mac 版 Zipeg / iZip / UnRarX
* 适用于 Linux 的 7-Zip / PeaZip
本书的代码包也托管在 GitHub 的 [https://github.com/PacktPublishing/Hands-on-Convolutional-Neural-Networks-with-Tensorflow](https://github.com/PacktPublishing/Hands-on-Convolutional-Neural-Networks-with-Tensorflow) 上。 如果代码有更新,它将在现有 GitHub 存储库上进行更新。
我们还从 **[https://github.com/PacktPublishing/](https://github.com/PacktPublishing/)** 提供了丰富的书籍和视频目录中的其他代码包。 去看一下!
# 使用约定
本书中使用了许多文本约定。
......@@ -94,21 +73,3 @@ $ pip install scipy
警告或重要提示如下所示。
提示和技巧如下所示。
\ No newline at end of file
# 保持联系
始终欢迎读者的反馈。
**一般反馈**:给`feedback@packtpub.com`发送电子邮件,并在邮件主题中提及书名。 如果您对本书的任何方面有疑问,请通过`questions@packtpub.com`向我们发送电子邮件。
**勘误表**:尽管我们已尽一切努力确保内容的准确性,但还是会发生错误。 如果您在这本书中发现错误,请向我们报告,我们将不胜感激。 请访问 [www.packtpub.com/submit-errata](http://www.packtpub.com/submit-errata) ,选择您的图书,点击勘误提交表格链接,然后输入详细信息。
**盗版**:如果您在互联网上以任何形式看到我们的作品的任何非法复制品,请向我们提供位置地址或网站名称,我们将不胜感激。 请通过`copyright@packtpub.com`与我们联系,并提供材料链接。
**如果您有兴趣成为作者**:如果您有某个专业知识并且有兴趣撰写或撰写书籍,请访问 [authors.packtpub.com](http://authors.packtpub.com/) ]。
# 评论
请留下评论。 阅读和使用本书后,为什么不在您购买本书的网站上留下评论? 然后,潜在的读者可以查看并使用您的公正意见做出购买决定,Packt 的我们可以理解您对我们产品的看法,我们的作者可以在书中看到您的反馈。 谢谢!
有关 Packt 的更多信息,请访问 [packtpub.com](https://www.packtpub.com/)
\ No newline at end of file
......@@ -54,7 +54,7 @@ TensorFlow 的优势之一是它允许您编写可以直接在 GPU 上运行的
Conda 环境允许您创建隔离的 Python 环境,该环境与系统 Python 或任何其他 Python 程序完全独立。 这样一来,您的 TensorFlow 安装就不会与已经安装的任何内容发生混乱,反之亦然。
要使用 conda,您必须从此处下载 Anaconda: [https://www.anaconda.com/download/](https://www.anaconda.com/download/) 。 这将包括 conda。 一旦安装了 Anaconda,即可通过在命令提示符中输入某些命令来完成 TensorFlow 的安装。 首先,输入以下内容:
要使用 conda,[您必须从此处下载 Anaconda](https://www.anaconda.com/download/)。 这将包括 conda。 一旦安装了 Anaconda,即可通过在命令提示符中输入某些命令来完成 TensorFlow 的安装。 首先,输入以下内容:
```py
$ conda create -n tf_env pip python=3.5
......@@ -104,7 +104,10 @@ Conda 环境允许您创建隔离的 Python 环境,该环境与系统 Python
您刚刚输入的是 TensorFlow 的`Hello World`。 您创建了一个包含单个`tf.constant`的图,该图只是一个常数 Tensor。 将字符串传递给 Tensor 时,推断其为 string 类型。 然后,您创建了一个 TensorFlow 会话,这是运行图形所必需的,并将您创建的 Tensor 上的会话告知`run`。 然后打印出 Session 运行的结果。 那里有一个额外的`b`,因为它是一个字节流。
如果没有看到上述内容并且出现一些错误,则最好的选择是检查以下页面,以获取安装时遇到的常见问题的解决方案:Ubuntu: [https://www.tensorflow.org/install/install_linux #common_installation_problems](https://www.tensorflow.org/install/install_linux#common_installation_problems) Windows: [https://www.tensorflow.org/install/install_windows#common_installation_problems](https://www.tensorflow.org/install/install_windows#common_installation_problems)
如果没有看到上述内容并且出现一些错误,则最好的选择是检查以下页面,以获取安装时遇到的常见问题的解决方案:
+ [Ubuntu](https://www.tensorflow.org/install/install_linux#common_installation_problems)
+ [Windows](https://www.tensorflow.org/install/install_windows#common_installation_problems)
# TensorFlow API 级别
......
......@@ -4,21 +4,21 @@
Here we're going to learn how to install and the basics of Tensorflow, as references we have:
* [https://www.tensorflow.org/tutorials/](https://www.tensorflow.org/tutorials/)
* [https://www.tensorflow.org/install/](https://www.tensorflow.org/install/)
* <https://www.tensorflow.org/tutorials/>
* <https://www.tensorflow.org/install/>
# Chapter 2
This chapter will tackle the principals of Machine Learning and Neural Networks with emphasis on Computer Vision with Convolutional Neural Networks. The references for the chapter are:
* [https://en.wikipedia.org/wiki/Artificial_neural_network](https://en.wikipedia.org/wiki/Artificial_neural_network)
* [https://en.wikipedia.org/wiki/Timeline_of_machine_learning](https://en.wikipedia.org/wiki/Timeline_of_machine_learning)
* [http://ais.informatik.uni-freiburg.de/teaching/ss11/ki/slides/ai12_acting_under_uncertainty_handout_4up.pdf](http://ais.informatik.uni-freiburg.de/teaching/ss11/ki/slides/ai12_acting_under_uncertainty_handout_4up.pdf)
* [http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf](http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf)
* [https://www.facebook.com/yann.lecun/posts/10152820758292143](https://www.facebook.com/yann.lecun/posts/10152820758292143)
* [https://towardsdatascience.com/types-of-convolutions-in-deep-learning-717013397f4d](https://towardsdatascience.com/types-of-convolutions-in-deep-learning-717013397f4d)
* [http://cs231n.stanford.edu/](http://cs231n.stanford.edu/)
* [http://cs224d.stanford.edu/](http://cs224d.stanford.edu/)
* <https://en.wikipedia.org/wiki/Artificial_neural_network>
* <https://en.wikipedia.org/wiki/Timeline_of_machine_learning>
* <http://ais.informatik.uni-freiburg.de/teaching/ss11/ki/slides/ai12_acting_under_uncertainty_handout_4up.pdf>
* <http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf>
* <https://www.facebook.com/yann.lecun/posts/10152820758292143>
* <https://towardsdatascience.com/types-of-convolutions-in-deep-learning-717013397f4d>
* <http://cs231n.stanford.edu/>
* <http://cs224d.stanford.edu/>
# Chapter 3
......@@ -26,64 +26,64 @@ This chapter will be cover image classification using Deep learning, and why CNN
* [Learning Multiple Layers of Features from Tiny Images](https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf), Alex Krizhevsky, 2009
* An excellent flashback on image representation techniques can be found in the *Computer Vision: Algorithms and Applications*, Richard Szeliski, 2010
* [http://www.vision.caltech.edu/Image_Datasets/Caltech101/](http://www.vision.caltech.edu/Image_Datasets/Caltech101/)
* <http://www.vision.caltech.edu/Image_Datasets/Caltech101/>
* Griffin, Gregory and Holub, Alex and Perona, Pietro (2007) Caltech–256 *Object Category Dataset*
* Everingham, M., Van Gool, L., Williams, C. K. I., Winn, J. and Zisserman, *A International Journal of Computer Vision*, 88(2), 303-338, 2010
* *ImageNet Large Scale Visual Recognition Challenge*, IJCV, 2015
* [https://wordnet.princeton.edu/](https://wordnet.princeton.edu/)
* <https://wordnet.princeton.edu/>
* *What Does Classifying More Than 10,000 Image Categories Tell Us?* Jia Deng, Alexander C. Berg, Kai Li, and Li Fei-Fei
* Olga Russakovsky, Jia Deng et al. (2015) *ImageNet Large Scale Visual Recognition Challenge*, [https://arxiv.org/pdf/1409.0575.pdf](https://arxiv.org/pdf/1409.0575.pdf)
* Olga Russakovsky, Jia Deng et al. (2015) *ImageNet Large Scale Visual Recognition Challenge*, <https://arxiv.org/pdf/1409.0575.pdf>
* Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton, *ImageNet Classification with Deep Convolutional Neural Networks*, 2012
* [https://arxiv.org/pdf/1311.2901.pdf](https://arxiv.org/pdf/1311.2901.pdf)
* <https://arxiv.org/pdf/1311.2901.pdf>
* *Going deeper with convolutions* by Christian Szegedy Google Inc. et al
* *Deep Residual Learning for Image Recognition*, Kaiming He et al.
* [https://arxiv.org/pdf/1709.01507.pdf](https://arxiv.org/pdf/1709.01507.pdf)
* The batch norm paper is a really well written paper that is easy to understand and explains the concept in much more detail, [https://arxiv.org/pdf/1502.03167.pdf](https://arxiv.org/pdf/1502.03167.pdf)
* <https://arxiv.org/pdf/1709.01507.pdf>
* The batch norm paper is a really well written paper that is easy to understand and explains the concept in much more detail, <https://arxiv.org/pdf/1502.03167.pdf>
# Chapter 4
In this chapter we will learn about object detection and segmentation. The references for this chapter are: 
* [https://arxiv.org/pdf/1311.2524.pdf](https://arxiv.org/pdf/1311.2524.pdf) (*Rich feature hierarchies for accurate object detection and semantic segmentation*)
* [https://arxiv.org/pdf/1504.08083.pdf](https://arxiv.org/pdf/1504.08083.pdf) (*Fast RCNN*)
* [https://arxiv.org/pdf/1506.01497.pdf](https://arxiv.org/pdf/1506.01497.pdf) (*Faster RCNN Towards Real-Time Object Detection with Region Proposals*)
* [https://www.youtube.com/watch?v=v5bFVbQvFRk](https://www.youtube.com/watch?v=v5bFVbQvFRk)
* [https://arxiv.org/pdf/1506.02640.pdf](https://arxiv.org/pdf/1506.02640.pdf) (*You Only Look Once: Unified, Real-Time Object Detection* )
* [https://coursera.org/specializations/deep-learning](https://coursera.org/specializations/deep-learning) (*Deep Learning* course by Andrew Ng)
* [https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf](https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf) (*Fully Convolutional Neural Network for Semantic Segmentation*)
* [https://arxiv.org/pdf/1606.00915.pdf](https://arxiv.org/pdf/1606.00915.pdf) ( Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs)
* <https://arxiv.org/pdf/1311.2524.pdf> (*Rich feature hierarchies for accurate object detection and semantic segmentation*)
* <https://arxiv.org/pdf/1504.08083.pdf> (*Fast RCNN*)
* <https://arxiv.org/pdf/1506.01497.pdf> (*Faster RCNN Towards Real-Time Object Detection with Region Proposals*)
* <https://www.youtube.com/watch?v=v5bFVbQvFRk>
* <https://arxiv.org/pdf/1506.02640.pdf> (*You Only Look Once: Unified, Real-Time Object Detection* )
* <https://coursera.org/specializations/deep-learning> (*Deep Learning* course by Andrew Ng)
* <https://people.eecs.berkeley.edu/~jonlong/long_shelhamer_fcn.pdf> (*Fully Convolutional Neural Network for Semantic Segmentation*)
* <https://arxiv.org/pdf/1606.00915.pdf> ( Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs)
# Chapter 5
In this chapter we will learn about some common CNN architectures (that is, VGG, ResNet, GoogleNet). The references for this chapter are: 
* Simonyan, K. and Zisserman, A., 2014, *Very Deep Convolutional Networks for Large-Scale Image Recognition*[arXiv preprint arXiv:1409.1556](https://arxiv.org/abs/1409.1556)
* *Going Deeper With Convolutions,* [https://arxiv.org/abs/1409.4842](https://arxiv.org/abs/1409.4842)
* [*Very Deep Convolutional Networks for Large-Scale Image Recognition*](https://arxiv.org/abs/1409.1556), Simonyan, K. and Zisserman, A., 2014, arXiv preprint arXiv:1409.1556
* *Going Deeper With Convolutions,* <https://arxiv.org/abs/1409.4842>
* *Deep Residual Learning for Image Recognition*, Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun, Microsoft Research
* *Mobilenets: Efficient Convolutional Neural Networks for Mobile Vision Applications*[https://arxiv.org/abs/1704.04861](https://arxiv.org/abs/1704.04861)
* [https://arxiv.org/pdf/1801.04381.pdf](https://arxiv.org/pdf/1801.04381.pdf), MobileNets V2
* *Mobilenets: Efficient Convolutional Neural Networks for Mobile Vision Applications*<https://arxiv.org/abs/1704.04861>
* <https://arxiv.org/pdf/1801.04381.pdf>, MobileNets V2
# Chapter 7
This chapter will discuss transfer learning and how we can take advantage of other people's model training to help us train our own networks. The references for this chapter are:
* [https://www.cse.ust.hk/~qyang/Docs/2009/tkde_transfer_learning.pdf](https://www.cse.ust.hk/~qyang/Docs/2009/tkde_transfer_learning.pdf)
* [ftp://ftp.cs.wisc.edu/machine-learning/shavlik-group/torrey.handbook09.pdf](ftp://ftp.cs.wisc.edu/machine-learning/shavlik-group/torrey.handbook09.pdf)
* [https://arxiv.org/pdf/1403.6382.pdf](https://arxiv.org/pdf/1403.6382.pdf) (*CNN Features off-the-shelf: an Astounding Baseline for Recognition*)
* [https://arxiv.org/pdf/1310.1531.pdf](https://arxiv.org/pdf/1310.1531.pdf) (*DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition*)
* <https://www.cse.ust.hk/~qyang/Docs/2009/tkde_transfer_learning.pdf>
* <ftp://ftp.cs.wisc.edu/machine-learning/shavlik-group/torrey.handbook09.pdf>
* <https://arxiv.org/pdf/1403.6382.pdf> (*CNN Features off-the-shelf: an Astounding Baseline for Recognition*)
* <https://arxiv.org/pdf/1310.1531.pdf> (*DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition*)
# Chapter 9
In the last chapter of this book we will learn how to take advantage of parallel cluster of computers in the cloud to accelerate model training. The references for this chapter are:
* [https://www.oreilly.com/ideas/distributed-tensorflow](https://www.oreilly.com/ideas/distributed-tensorflow)
* [https://research.fb.com/wp-content/uploads/2017/06/imagenet1kin1h5.pdf](https://research.fb.com/wp-content/uploads/2017/06/imagenet1kin1h5.pdf)
* [https://learningtensorflow.com/lesson11/](https://learningtensorflow.com/lesson11/)
* [https://www.tensorflow.org/deploy/distributed](https://www.tensorflow.org/deploy/distributed)
* [https://www.tensorflow.org/programmers_guide/low_level_intro](https://www.tensorflow.org/programmers_guide/low_level_intro)
* [https://github.com/tmulc18/Distributed-TensorFlow-Guide](https://github.com/tmulc18/Distributed-TensorFlow-Guide)
* [https://clusterone.com/blog/2017/09/13/distributed-tensorflow-clusterone/](https://clusterone.com/blog/2017/09/13/distributed-tensorflow-clusterone/)
* [https://www.youtube.com/watch?v=-h0cWBiQ8s8&](https://www.youtube.com/watch?v=-h0cWBiQ8s8&)
* [https://www.youtube.com/watch?v=uIcqeP7MFH0](https://www.youtube.com/watch?v=uIcqeP7MFH0)
* [https://www.youtube.com/watch?v=bRMGoPqsn20](https://www.youtube.com/watch?v=bRMGoPqsn20)
* [https://www.youtube.com/watch?v=1cHx1baKqq0](https://www.youtube.com/watch?v=1cHx1baKqq0)
\ No newline at end of file
* <https://www.oreilly.com/ideas/distributed-tensorflow>
* <https://research.fb.com/wp-content/uploads/2017/06/imagenet1kin1h5.pdf>
* <https://learningtensorflow.com/lesson11/>
* <https://www.tensorflow.org/deploy/distributed>
* <https://www.tensorflow.org/programmers_guide/low_level_intro>
* <https://github.com/tmulc18/Distributed-TensorFlow-Guide>
* <https://clusterone.com/blog/2017/09/13/distributed-tensorflow-clusterone/>
* <https://www.youtube.com/watch?v=-h0cWBiQ8s8&>
* <https://www.youtube.com/watch?v=uIcqeP7MFH0>
* <https://www.youtube.com/watch?v=bRMGoPqsn20>
* <https://www.youtube.com/watch?v=1cHx1baKqq0>
\ No newline at end of file
......@@ -134,13 +134,13 @@ CIFAR-10 和 CIFAR-100 数据集是 Alex Krizhevsky,Vinod Nair 和 Geoffrey Hi
![](img/ebce31e0-9bce-4667-971c-53b650f46389.jpg)
CIFAR-100 具有 100 个类别,每个类别 600 张图像。 这 100 个类别分为 20 个超类。 每个图像都有一个**精细**标签(它属于的类)和一个**粗糙**标签(它属于的超类)。 CIFAR-100 中的类和超类的列表可在 [https://www.cs.toronto.edu/~kriz/cifar.html](https://www.cs.toronto.edu/~kriz/cifar.html) 中找到。 将类别的数量从粗糙(20)增加到精细(100)有助于最大程度地提高类别间的可变性。 这意味着我们希望模型考虑图像中两个看起来相似的对象属于不同的类。 例如,一张床和一张沙发看起来相似但不完全相同,将它们放在单独的类中将确保它们与受训模型看起来不同。
CIFAR-100 具有 100 个类别,每个类别 600 张图像。 这 100 个类别分为 20 个超类。 每个图像都有一个**精细**标签(它属于的类)和一个**粗糙**标签(它属于的超类)。 CIFAR-100 中的类和超类的列表可在[这个页面](https://www.cs.toronto.edu/~kriz/cifar.html)中找到。 将类别的数量从粗糙(20)增加到精细(100)有助于最大程度地提高类别间的可变性。 这意味着我们希望模型考虑图像中两个看起来相似的对象属于不同的类。 例如,一张床和一张沙发看起来相似但不完全相同,将它们放在单独的类中将确保它们与受训模型看起来不同。
CIFAR 的算法评估过程与 ImageNet 中的相同。 据 Saining Xie 等人报道,CIFAR-10 的报告最好的 top-1 误差为 3.58%,而 CIFAR-100 的误差为 17.31%。 深入神经网络的*聚合残差转换中,他们介绍了新颖的 ResNeXt 体系结构。 可以在[中找到有关在 CIFAR-10 和 CIFAR-100](http://rodrigob.github.io/are_we_there_yet/build/classification_datasets_results.html)* 上使用*深度学习结果进行图像分类的最新技术 http://rodrigob.github.io/are_we_there_yet/ build / classification_datasets_results.html 和 [https://github.com/RedditSota/state-of-the-art-result-for-machine-learning-problems](https://github.com/RedditSota/state-of-the-art-result-for-machine-learning-problems) 。*
CIFAR 的算法评估过程与 ImageNet 中的相同。 据 Saining Xie 等人报道,CIFAR-10 的报告最好的 top-1 误差为 3.58%,而 CIFAR-100 的误差为 17.31%。 深入神经网络的聚合残差转换中,他们介绍了新颖的 ResNeXt 体系结构。 可以在[这里](http://rodrigob.github.io/are_we_there_yet/build/classification_datasets_results.html)[这里](https://github.com/RedditSota/state-of-the-art-result-for-machine-learning-problems)找到在 CIFAR-10 和 CIFAR-100 上将深度学习结果用于图像分类的最新技术。
# 加载 CIFAR
可以从前面提到的 Python,Matlab 和二进制版本的官方网站下载数据集。 有多种加载和读取这些数据集的方法。 实际上,在我们的 TensorFlow 实现中,我们使用 Keras 库( [https://keras.io/](https://keras.io/datasets/)加载它,该库现在是`tf.keras`模块中 TensorFlow 的一部分。 在这里,我们提供了一些示例代码来加载 CIFAR-10 数据集,但是 CIFAR-100 数据集的加载方式几乎相同:
可以从前面提到的 Python,Matlab 和二进制版本的官方网站下载数据集。 有多种加载和读取这些数据集的方法。 实际上,在我们的 TensorFlow 实现中,我们使用 [Keras 库](https://keras.io/datasets/)加载它,该库现在是`tf.keras`模块中 TensorFlow 的一部分。 在这里,我们提供了一些示例代码来加载 CIFAR-10 数据集,但是 CIFAR-100 数据集的加载方式几乎相同:
```py
import tensorflow as tf
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册