@@ -383,7 +383,7 @@ Amazon Textract 使用户可以从文档,表单和表格中提取文本。 Ama
Microsoft Azure Machine Learning Studio 是 Microsoft 对 Amazon SageMaker 的回答。 Machine Learning Studio 是一个协作工具,具有简单的拖放界面,允许用户构建,测试和部署机器学习模型。 Machine Learning Studio 支持模型发布,该模型发布可被其他应用程序使用,并可轻松与 BI 工具(例如 Excel)集成。
**Machine Learning Studio 交互式工作区** –在*第 3 章*,*机器学习管道*中,我们学习了关于机器学习管道的信息。 Machine Learning Studio 交互式工作区通过允许用户轻松地将数据摄取到工作区,转换数据,然后通过各种数据操作和统计功能分析数据并最终生成预测,从而简化了管道开发。 开发机器学习管道通常是一个迭代过程,而工作区使执行此迭代开发变得简单。 在修改各种功能及其参数时,您将能够可视化和分析模型的性能,直到对结果满意为止。
**Machine Learning Studio 交互式工作区** –在第 3 章,“机器学习管道”中,我们学习了关于机器学习管道的信息。 Machine Learning Studio 交互式工作区通过允许用户轻松地将数据摄取到工作区,转换数据,然后通过各种数据操作和统计功能分析数据并最终生成预测,从而简化了管道开发。 开发机器学习管道通常是一个迭代过程,而工作区使执行此迭代开发变得简单。 在修改各种功能及其参数时,您将能够可视化和分析模型的性能,直到对结果满意为止。
Azure Machine Learning Studio 提供了一个交互式的可视化工作区,可以轻松地构建,测试和迭代预测分析模型。 要将数据集带入工作区,可以将其拖放。 您还可以将分析模块拖到交互式画布上,并将它们连接在一起以形成初始*实验*,然后可以在 Machine Learning Studio 中运行。 如果结果不令人满意,可以修改实验参数并一次又一次地运行直到结果令人满意。 一旦性能令人满意,就可以将*训练实验*转换为*预测性实验*,并且可以将其发布为网络服务,以便用户和其他服务可以访问该模型 。
![1: A recurrent neural network and the unfolding in time of the computation involved in its forward computation. Source: LeCun, Bengio, and G. Hinton 2015 ](img/B15441_21_06.png)
GAN 的体系结构具有两个基本元素:生成器网络和鉴别器网络。 每个网络都可以是任何神经网络,例如**人工神经网络**(**ANN**),**卷积神经网络**(**CNN**), **递归神经网络**(**RNN**),或**长短期记忆**(**LSTM**)。 鉴别器必须具有完全连接的层,最后是分类器。
GAN 的体系结构具有两个基本元素:生成器网络和鉴别器网络。 每个网络都可以是任何神经网络,例如**人工神经网络**(**ANN**),**卷积神经网络**(**CNN**), **循环神经网络**(**RNN**),或**长短期记忆**(**LSTM**)。 鉴别器必须具有完全连接的层,最后是分类器。
第 8 章,*使用 RNN 预测股票价格*带领您完成 RNN 以及如何使用它预测股票价格。 然后,我们将向您介绍如何使用 TensorFlow API 构建 RNN 模型以预测股价,以及如何使用易于使用的 Keras API 构建 RNN LSTM 模型以实现相同的目标。 我们将测试并查看此类模型是否可以击败随机购买或出售策略。 最后,我们将向您展示如何在 iOS 和 Android 应用程序中运行 TensorFlow 和 Keras 模型。
第 8 章,“使用 RNN 预测股票价格”带领您完成 RNN 以及如何使用它预测股票价格。 然后,我们将向您介绍如何使用 TensorFlow API 构建 RNN 模型以预测股价,以及如何使用易于使用的 Keras API 构建 RNN LSTM 模型以实现相同的目标。 我们将测试并查看此类模型是否可以击败随机购买或出售策略。 最后,我们将向您展示如何在 iOS 和 Android 应用程序中运行 TensorFlow 和 Keras 模型。
第 9 章,*使用 GAN* 生成和增强图像,概述了 GAN 是什么以及为什么它具有如此大的潜力。 然后,它将探讨如何构建和训练可用于生成类似人的手写数字的基本 GAN 模型以及可以将低分辨率图像增强为高分辨率图像的更高级模型。 最后,我们将介绍如何在 iOS 和 Android 应用程序中使用两种 GAN 模型。
第 9 章,“使用 GAN 生成和增强图像”,概述了 GAN 是什么以及为什么它具有如此大的潜力。 然后,它将探讨如何构建和训练可用于生成类似人的手写数字的基本 GAN 模型以及可以将低分辨率图像增强为高分辨率图像的更高级模型。 最后,我们将介绍如何在 iOS 和 Android 应用程序中使用两种 GAN 模型。
RNN allows us to handle sequences of input and/or output, because the network, by design, has memory of previous items in an input sequence or can generate a sequence of output. This makes RNN more appropriate for speech recognition, (where the input is a sequence of words uttered by users), image captioning, (where the output is a natural language sentence consisting of a series of words), text generation, and time series prediction. If you're unfamiliar with RNN, you should definitely check out *Andrey Karpathy's* blog, *The Unreasonable Effectiveness of Recurrent Neural Networks* ([http://karpathy.github.io/2015/05/21/rnn-effectiveness](http://karpathy.github.io/2015/05/21/rnn-effectiveness)). We'll also cover some detailed RNN models later in the book.
If you don't have a good understanding of all these details, don't worry; to develop powerful mobile apps using a model built by others, you don't have to understand all the details, but in the next chapter we'll also discuss in greater detail how you can build a RNN model from scratch for stock prediction, and with that, you'll have a better understanding of all the RNN stuff.
事实是,当我们处理各种惊人的模型时,我们不得不面对不可避免的问题只是时间问题:我们必须手动为 Android 构建 TensorFlow 库,以修复默认 TensorFlow 库中的一些错误 根本无法应对。 `No OpKernel was registered to support Op 'RefSwitch' with these attrs.`错误就是这样的错误之一。 对于乐观的开发人员来说,这仅意味着另一种向您的技能组合中添加新技巧的机会。
Changing `tensorflow/core/platform/default/mutex.h` back and forth certainly is not an ideal solution. It's supposed to be just as a workaround. As it only needs to be changed when you start using a manually built TensorFlow iOS library or when you build a custom TensorFlow library, we can live with it for now.
The other type of RNN that solves the vanishing gradient problem nicely is called **Gated Recurrent Unit** (**GRU**), which simplifies standard LSTM models a bit and is becoming more popular. Both TensorFlow and Keras APIs support basic RNN and LSTM/GRU models. In the next two sections, you'll see concrete TensorFlow and Keras APIs for using RNN and standard LSTM, and you can simply replace "LSTM" with "GRU" in the code to use and compare the results of using the GRU model with RNN and standard LSTM models.
@@ -1322,7 +1322,7 @@ void softmax(float vals[], int count) {
在本章中,我们介绍了 AlphaZero 的惊人世界,这是 DeepMind 截至 2017 年 12 月的最新和最大成就。我们向您展示了如何使用功能强大的 Keras API 和 TensorFlow 后端为 Connect 4 训练类似 AlphaZero 的模型,以及 如何测试并可能改善这种模型。 然后,我们冻结了该模型,并详细介绍了如何构建 iOS 和 Android 应用程序以使用该模型,以及如何使用基于模型的 AI 玩 Connect 4。 尚不能完全击败人类象棋或 GO 冠军的确切 AlphaZero 模型,但我们希望本章为您提供扎实的基础,并激发您继续进行工作,以复制 AlphaZero 最初所做的工作并将其进一步扩展到其他问题领域。 这将需要很多努力,但完全值得。
如果最新的 AI 进展(例如 AlphaZero)使您兴奋不已,那么您还可能会发现由 TensorFlow 驱动的最新移动平台解决方案或工具包令人兴奋。 TensorFlow Lite,如我们在[第 1 章中提到的, *移动 TensorFlow 入门* ,是 TensorFlow Mobile 的替代解决方案,我们 在前面的所有章节中都有介绍。 根据 Google 的说法,TensorFlow Lite 将成为 TensorFlow 在移动设备上的未来,尽管在此时和可预见的将来,TensorFlow Mobile 仍应用于生产场合。](../Text/01.html)
如果最新的 AI 进展(例如 AlphaZero)使您兴奋不已,那么您还可能会发现由 TensorFlow 驱动的最新移动平台解决方案或工具包令人兴奋。 如我们在第 1 章“移动 TensorFlow 入门”中提到的,TensorFlow Lite 是 TensorFlow Mobile 的替代解决方案,我们 在前面的所有章节中都有介绍。 根据 Google 的说法,TensorFlow Lite 将成为 TensorFlow 在移动设备上的未来,尽管在此时和可预见的将来,TensorFlow Mobile 仍应用于生产场合。
虽然 TensorFlow Lite 在 iOS 和 Android 上均可使用,但在 Android 设备上运行时,它也可以利用 Android Neural Networks API 进行硬件加速。 另一方面,iOS 开发人员可以利用 Core ML, Apple 针对 iOS 11 或更高版本的最新机器学习框架,该框架支持运行许多强大的预训练深度学习模型,以及使用 经典的机器学习算法和 Keras,以优化的方式在设备上以最小的应用程序二进制文件大小运行。 在下一章中,我们将介绍如何在 iOS 和 Android 应用程序中使用 TensorFlow Lite 和 Core ML。
要运行脚本,请先从[这里](http://download.tensorflow.org/models/speech_commands_v0.01.zip)下载预训练的音频识别模型,然后将其解压缩到`/tmp`,或者对我们在第 5 章“了解简单语音命令”中使用的模型使用`scp`到 Pi 板的`/tmp`目录,然后运行:
在之前的章节中,我们主要使用 Python 训练和测试 TensorFlow 模型,然后再使用本机 TensorFlow C ++库的 Java 接口代码在使用 C ++或 Android 的 iOS 中运行模型。 在 Raspberry Pi 上,您可以选择直接使用 TensorFlow Python API 或 C ++ API 在 Pi 上运行 TensorFlow 模型,尽管通常仍会在功能更强大的模型上进行训练 电脑。 有关完整的 TensorFlow Python API 文档,请参见[这里](https://www.tensorflow.org/api_docs/python)。