提交 d65234ac 编写于 作者: W wizardforcel

2020-12-10 11:46:22

上级 4785bfb6
......@@ -286,8 +286,9 @@ The architecture of the discriminator network
前面的等式表示实际图像`x`,与生成的图像`g`之间的 FID 分数。 为了计算 FID 分数,我们使用 Inception 网络从 Inception 网络的中间层提取特征图。 然后,我们对多元高斯分布建模,以学习特征图的分布。 此多元高斯分布具有 **![](img/f5267071-9d06-4928-bc77-cfc450d6e3a6.png)** 的均值和![](img/91c575c7-94bc-4803-ad27-cc9d948d77be.png) 的协方差,我们用它们来计算 FID 得分。 FID 分数越低,模型越好,它越有能力生成更高质量的更多图像。 完美的生成模型的 FID 得分为零。 使用 FID 得分而不是 Inception 得分的优势在于它对噪声具有鲁棒性,并且可以轻松地测量图像的多样性。
The TensorFlow implementation of FID can be found at the following link: [https://www.tensorflow.org/api_docs/python/tf/contrib/gan/eval/frechet_classifier_distance](https://www.tensorflow.org/api_docs/python/tf/contrib/gan/eval/frechet_classifier_distance)
There are more scoring algorithms available that have been recently proposed by researchers in academia and industry. We won't be covering all of these here. Before reading any further, take a look at another scoring algorithm called the Mode Score, information about which can be found at the following link: [https://arxiv.org/pdf/1612.02136.pdf](https://arxiv.org/pdf/1612.02136.pdf).
[FID 的 TensorFlow 实现可在以下链接中找到](https://www.tensorflow.org/api_docs/python/tf/contrib/gan/eval/frechet_classifier_distance)
学术界和工业界的研究人员最近提出了更多的评分算法。 我们不会在这里介绍所有这些内容。 在进一步阅读之前,请查看另一种称为模式得分的评分算法,[有关该算法的信息可在以下链接中找到](https://arxiv.org/pdf/1612.02136.pdf)
......@@ -357,7 +358,7 @@ CycleGAN 由朱俊彦,Taesung Park,Phillip Isola 和 Alexei A. Efros 在题
pix2pix 网络是由 Phillip Isola,朱俊彦,周廷辉和 Alexei A. Efros 在他们的论文《使用条件对抗网络的图像到图像翻译》中介绍的,[可通过以下链接获得](https://arxiv.org/abs/1611.07004)。 pix2pix 网络具有与 CycleGAN 网络类似的用例。 它可以将建筑物标签转换为建筑物图片(我们将在 pix2pix 章节中看到一个类似的示例),黑白图像转换为彩色图像,将白天至夜晚的图像,草图转换为照片, 和航拍图像到类似地图的图像。
For a list of all the GANs in existence, refer to *The GAN Zoo*, an article by Avinash Hindupur available at [https://github.com/hindupuravinash/the-gan-zoo](https://github.com/hindupuravinash/the-gan-zoo).
有关现有所有GAN的列表,请参阅 [GAN Zoo](https://github.com/hindupuravinash/the-gan-zoo),这是 Avinash Hindupur 的文章。
......
......@@ -228,7 +228,7 @@ pip install -r requirements.txt
在本章中,我们将使用`Wiki-Cropped`数据集,其中包含 64 张以上 328 张不同人脸的图像。 作者还提供了数据集 ,该数据集仅包含已裁剪的面部,因此我们无需裁剪面部。
The authors of the paper titled *Deep expectation of real and apparent age from a single image without facial landmarks,* which is available at[https://www.vision.ee.ethz.ch/en/publications/papers/articles/eth_biwi_01299.pdf](https://www.vision.ee.ethz.ch/en/publications/papers/articles/eth_biwi_01299.pdf), have scraped these images from Wikipedia and made them available for academic purposes. If you intend to use the dataset for commercial purposes, contact the authors at `rrothe@vision.ee.ethz.ch`.
论文《没有面部标志的单张图像的真实年龄和外表年龄的深度期望》,[可在以下网址获得](https://www.vision.ee.ethz.ch/en/publications/papers/articles/eth_biwi_01299.pdf)。作者从维基百科抓取了这些图片,并将其用于学术目的。 如果您打算将数据集用于商业目的,请通过以下方式与作者联系:`rrothe@vision.ee.ethz.ch`
您可以从[以下链接](https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/)手动下载数据集,并将所有压缩文件放置在 Age-cGAN 项目内的目录中。
......
......@@ -233,7 +233,7 @@ X = (T * np.random.uniform(1.0, 1.5, size=(100, 1))) + np.random.normal(0.0, 3.5
df = pd.DataFrame(np.concatenate([T, X], axis=1), columns=['t', 'x'])
```
We have also created a pandas `DataFrame` because it's easier to create plots using the seaborn library ([https://seaborn.pydata.org](https://seaborn.pydata.org)). In the book, the code for the plots (using Matplotlib or seaborn) is normally omitted, but it's always present in the repository.
我们还创建了一个 [Pandas](https://seaborn.pydata.org) `DataFrame`,因为使用 seaborn 库创建图更容易。在这本书中,通常会省略绘图的代码(使用 Matplotlib 或 seaborn),但它始终存在于存储库中。
我们希望以一种综合的方式表示数据集,如下所示:
......
......@@ -88,7 +88,7 @@ TensorFlow 是 Google 的开放源代码框架,用于构建机器学习 AI 应
当然,我们不能保证所有代码在将来的所有 TensorFlow 版本中都不会更改而运行,但是无论书本是在什么时候阅读,无论现在还是几个月后,本书中都包含了所有详细的教程和故障排除技巧,您应该 使用 TensorFlow 1.4-1.8 或更高版本,可以使阅读本书和在本书中运行应用程序的过程顺利进行。
As we have to stop with a specific TensorFlow version at certain points to get the book published, we'll continue to test run all the code in the book with every new major TensorFlow release, and update the code and test results accordingly on the book's source code repository at [http://github.com/jeffxtang/mobiletfbook](http://github.com/jeffxtang/mobiletfbook). If you have any questions about the code or the book, you may also post an issue directly on the repository.
由于我们必须在某些时候停止使用特定的 TensorFlow 版本才能出版该书,因此我们将继续在每个新的主要 TensorFlow 版本中测试运行该书中的所有代码,并相应地在[源代码存储库](http://github.com/jeffxtang/mobiletfbook)中更新该书的代码和测试结果。 如果您对代码或书籍有任何疑问,也可以直接在存储库中发布问题。
另一个问题是 TensorFlow Mobile 和 TensorFlow Lite 之间的选择。 该书在大多数章节(1 至 10)中介绍了 TensorFlow Mobile。 TensorFlow Lite 可能是在移动设备上运行 TensorFlow 的未来,它在 Google I/O 2018 上仍处于开发人员预览版中,这就是 Google 希望您“使用 TensorFlow Mobile 覆盖生产案例”的原因。 即使在 TensorFlow Lite 正式发布后,根据 Google 的说法,“ TensorFlow Mobile 不会很快消失”-实际上,在本书出版之前我们测试了最新的 TensorFlow 1.8.0 版本,我们发现 使用 TensorFlow Mobile 变得更加简单
......
......@@ -27,13 +27,13 @@
TensorFlow 是领先的机器智能开源框架。 当 Google 在 2015 年 11 月将 TensorFlow 作为一个开源项目发布时,已经有其他一些类似的深度学习开源框架:Caffe,Torch 和 Theano。 在 5 月 10 日的 Google I/O 2018 上,GitHub 上的 TensorFlow 已达到 99000 星,在 4 个月内增加了 14k 星,而 Caffe 仅增加了 2k 至 24k 星。 两年后,它已经成为最流行的开源框架,用于训练和部署深度学习模型(它对传统机器学习也有很好的支持)。 截至 2018 年 1 月,TensorFlow 在 GitHub 上拥有[近 8.5 万颗星](https://github.com/tensorflow/tensorflow),而其他三个领先的开源深度学习框架 [Caffe](https://github.com/BVLC/caffe)[CNTK](https://github.com/Microsoft/CNTK)[Mxnet](https://github.com/apache/incubator-mxnet) 分别拥有 22k,13k 和 12k 颗星。
If you're a little confused about the buzz words machine learning, deep learning, machine intelligence, and artificial intelligence (AI), here's a quick summary: machine intelligence and AI are really just the same thing; machine learning is a field, also the most popular one, of AI; deep learning is one special type of machine learning, and is also the modern and most effective approach to solving complicated problems such as computer vision, speech recognition and synthesis, and natural language processing. So in this book, when we say AI, we primarily mean deep learning, the savior that took AI from the long winter to the summer. For more information about the AI winter and deep learning, you can check out [https://en.wikipedia.org/wiki/AI_winter](https://en.wikipedia.org/wiki/AI_winter) and [http://www.deeplearningbook.org](http://www.deeplearningbook.org).
如果您对机器学习,深度学习,机器智能和人工智能(AI)的流行语有些困惑,这里有个简短的摘要:机器智能和 AI 确实是同一回事。 机器学习是 AI 的一个领域,也是最受欢迎的领域; 深度学习是机器学习的一种特殊类型,也是解决诸如计算机视觉,语音识别和合成以及自然语言处理之类的复杂问题的现代且最有效的方法。 因此,在本书中,当我们说 AI 时,我们主要是指深度学习,这是将AI从漫长的冬天带到夏天的救星。 有关 AI 冬季和深度学习的更多信息,您可以查看[这里](https://en.wikipedia.org/wiki/AI_winter)[这里](http://www.deeplearningbook.org)
我们假设您已经对 TensorFlow 有了基本的了解,但是如果您还没有,请查看[入门](https://www.tensorflow.org/get_started)[教程](https://www.tensorflow.org/tutorials)部分或 [Awesome TensorFlow 教程](https://github.com/jtoy/awesome-tensorflow)。 关于该主题的两本好书是《Python 机器学习:Python , scikit-learn 和 TensorFlow 机器学习和深度学习》和《使用 Scikit-Learn 和 TensorFlow 动手进行机器学习》。
TensorFlow 可以安装在 MacOS,Ubuntu 或 Windows 上。 我们将介绍在 MacOS X El Capitan(10.11.6),macOS Sierra(10.12.6)和 Ubuntu 16.04 上从源代码安装 TensorFlow 1.4 的步骤。 如果您使用其他操作系统或版本,则可以参考 [TensorFlow 安装文档](https://www.tensorflow.org/install)以获取更多信息。 当您阅读本书时,可能会出现更新的 TensorFlow 版本。 尽管您仍然应该能够使用较新版本运行本书中的代码,但这并不能保证,因此我们在 Mac 和 Ubuntu 上使用 TensorFlow 1.4 发行源代码来设置 TensorFlow; 这样,您可以轻松地测试运行并与书中的应用程序一起玩。
Since we wrote the paragraph above in December 2017, there have been four new official releases of TensorFlow (1.5, 1.6, 1.7, and 1.8), which you can download at [https://github.com/tensorflow/tensorflow/releases](https://github.com/tensorflow/tensorflow/releases) or from the TensorFlow source code repo ([https://github.com/tensorflow/tensorflow](https://github.com/tensorflow/tensorflow)), and a new version of Xcode (9.3) as of May 2018\. Newer versions of TensorFlow, such as 1.8, by default support newer versions of NVIDIA CUDA and cuDNN (see the section *Setting up TensorFlow on GPU-powered Ubuntu* for detail), and you'd better follow the official TensorFlow documentation to install the latest TensorFlow version with GPU support. In this and the following chapters, we may refer to a specific TensorFlow version as an example, but will keep all iOS, Android, and Python code tested and, if needed, updated for the latest TensorFlow, Xcode, and Android Studio versions in the book's source code repo at [https://github.com/jeffxtang/mobiletfbook](https://github.com/jeffxtang/mobiletfbook).
自从我们于 2017 年 12 月撰写以上段落以来,TensorFlow 已有四个新的正式版本(1.5、1.6、1.7和1.8),以及截至 2018 年 5 月的新版本 Xcode(9.3),您可以在[以下位置](https://github.com/tensorflow/tensorflow/releases)下载, 或在 TensorFlow [源代码仓库](https://github.com/tensorflow/tensorflow)。 TensorFlow 的较新版本(例如 1.8)默认情况下支持 NVIDIA CUDA 和 cuDNN 的较新版本(有关详细信息,请参阅“在 Ubuntu 上设置基于 GPU 的 TensorFlow”部分),并且最好遵循官方的 TensorFlow 文档来安装具有 GPU 支持的最新 TensorFlow 版本。 在本章及以下各章中,我们将以特定的 TensorFlow 版本为例,但将对所有 iOS,Android 和 Python 代码进行测试,并在需要时针对其中的最新 TensorFlow,Xcode 和 Android Studio 版本进行更新。 本书的源代码仓库位于[这里](https://github.com/jeffxtang/mobiletfbook)
总体而言,我们将在 Mac 上使用 TensorFlow 开发 iOS 和 Android TensorFlow 应用程序,并在 Ubuntu 上使用 TensorFlow 训练应用中使用的深度学习模型。
......@@ -95,7 +95,7 @@ sudo pip install --upgrade /tmp/tensorflow_pkg/tensorflow-1.4.0-cp27-cp27m-macos
为了训练本书中应用程序中部署的模型,我们使用 NVIDIA GTX 1070,您可以在 Amazon 或 eBay 上以大约 400 美元的价格购买。 蒂姆·戴特默斯(Tim Dettmers)有一个不错的博客,其中介绍了[用于深度学习的 GPU](http://timdettmers.com/2017/04/09/which-gpu-for-deep-learning/)。 在获得这样的 GPU 并将其安装在 Ubuntu 系统上之后,以及在安装启用 GPU 的 TensorFlow 之前,您需要安装 NVIDIA CUDA 8.0(或 9.0)和 cuDNN(CUDA-DeepNeuralNetwork)6.0 (或 7.0),两者均受 TensorFlow 1.4 支持。
An alternative to setting up your own GPU-powered Ubuntu with TensorFlow is to use TensorFlow in a GPU-enabled cloud service such as Google Cloud Platform's Cloud ML Engine ([https://cloud.google.com/ml-engine/docs/using-gpus](https://cloud.google.com/ml-engine/docs/using-gpus)). There are pros and cons of each option. Cloud services are generally time-based billing. If your goal is to train or retrain models to be deployed on mobile devices, meaning the models are not super complicated, and if you plan to do machine learning training for a long time, it'd be more cost effective and satisfying to have your own GPU.
使用 TensorFlow 设置自己的 GPU 驱动的 Ubuntu 的另一种方法是[在支持 GPU 的云服务(例如Google Cloud Platform 的 Cloud ML Engine)中使用 TensorFlow](https://cloud.google.com/ml-engine/docs/using-gpus)。 每个选项都有优点和缺点。 云服务通常是基于时间的计费。 如果您的目标是训练或重新训练要在移动设备上部署的模型,这意味着模型并不复杂,并且如果您计划长时间进行机器学习训练,那么拥有自己的 GPU 成本效益更高并且令人满意。
请按照以下步骤在 Ubuntu 16.04 上安装 CUDA 8.0 和 cuDNN 6.0(您应该能够以类似的方式下载并安装 CUDA 9.0 和 cuDNN 7.0):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册