[第 8 章](../Text/8.html),*条件 GAN –使用条件对抗网络* 进行图像到图像的翻译,介绍了如何训练条件 GAN 进行图像到图像的翻译。 我们将首先介绍条件 GAN 和不同的数据准备技术,例如数据收集,数据清理和数据格式化。 接下来,我们将在 Jupyter Notebook 的 Keras 中编写条件 GAN 的代码。 接下来,我们学习如何在已经准备好的数据集上训练条件 GAN。 我们将探索不同的超参数进行训练。 最后,我们将测试条件 GAN,并讨论实际应用中图像到图像转换的不同用例。
第 8 章,*条件 GAN –使用条件对抗网络* 进行图像到图像的翻译,介绍了如何训练条件 GAN 进行图像到图像的翻译。 我们将首先介绍条件 GAN 和不同的数据准备技术,例如数据收集,数据清理和数据格式化。 接下来,我们将在 Jupyter Notebook 的 Keras 中编写条件 GAN 的代码。 接下来,我们学习如何在已经准备好的数据集上训练条件 GAN。 我们将探索不同的超参数进行训练。 最后,我们将测试条件 GAN,并讨论实际应用中图像到图像转换的不同用例。
[第 9 章](../Text/9.html),*预测 GAN 的未来*,是最后一章。 在介绍了 GAN 的基础知识并完成了六个项目之后,本章将使读者了解 GAN 的未来。 在这里,我们将研究在过去的 3-4 年中,GAN 的采用取得了惊人的成就,以及该行业对它的接受程度。 我还将讨论我对 GAN 未来的个人看法。
第 9 章,*预测 GAN 的未来*,是最后一章。 在介绍了 GAN 的基础知识并完成了六个项目之后,本章将使读者了解 GAN 的未来。 在这里,我们将研究在过去的 3-4 年中,GAN 的采用取得了惊人的成就,以及该行业对它的接受程度。 我还将讨论我对 GAN 未来的个人看法。
3D-GAN 由 Wu Jiajun Wu,Zhengkai Zhang,薛天凡,William T. Freeman 和 Joshua B. Tenenbaum 在其名为*的论文中提出,该论文通过 3D 生成-专家对模型学习概率形状的对象形状*,[可通过以下链接获得](https://arxiv.org/pdf/1610.07584)。 在制造业和 3D 建模行业中,生成对象的 3D 模型具有许多用例。 一旦在对象的 3D 模型上进行训练,3D-GAN 网络便能够生成不同对象的新 3D 模型。 我们将在[第 2 章](../Text/2.html)和*3D-GAN-使用* GAN 生成形状中学习如何使用 3D-GAN 生成对象的 3D 模型。
3D-GAN 由 Wu Jiajun Wu,Zhengkai Zhang,薛天凡,William T. Freeman 和 Joshua B. Tenenbaum 在其名为*的论文中提出,该论文通过 3D 生成-专家对模型学习概率形状的对象形状*,[可通过以下链接获得](https://arxiv.org/pdf/1610.07584)。 在制造业和 3D 建模行业中,生成对象的 3D 模型具有许多用例。 一旦在对象的 3D 模型上进行训练,3D-GAN 网络便能够生成不同对象的新 3D 模型。 我们将在第 2 章,*3D-GAN-使用* GAN 生成形状中学习如何使用 3D-GAN 生成对象的 3D 模型。
**3D 生成对抗网络**(**3D-GAN**)是 GAN 的变体,就像 StackGAN,CycleGAN 和*`S`***上层分辨率一样 生成对抗网络**(**SRGAN**)。 与香草 GAN 相似,它具有生成器和鉴别器模型。 这两个网络都使用 3D 卷积层,而不是使用 2D 卷积。 如果提供足够的数据,它可以学习生成具有良好视觉质量的 3D 形状。
**3D 生成对抗网络**(**3D-GAN**)是 GAN 的变体,就像 StackGAN,CycleGAN 和`S`**上层分辨率一样 生成对抗网络**(**SRGAN**)。 与香草 GAN 相似,它具有生成器和鉴别器模型。 这两个网络都使用 3D 卷积层,而不是使用 2D 卷积。 如果提供足够的数据,它可以学习生成具有良好视觉质量的 3D 形状。
![](img/5630c46a-e57c-4099-bcf2-bc30a9ed942e.png)Example of complete linkage. C<subclass="calibre26">1</sub> and C<subclass="calibre26">3</sub> are selected for merging
The script was originally written for TensorFlow 0.12 but modified later for TensorFlow 1.1, and has been verified to also run OK in the TensorFlow 1.4 with Python 2.7 environment we set up earlier.
The process on how to fix the "Not found: Op type not registered" error is a big takeaway from this chapter, as it can possibly save you a lot of time when working on other TensorFlow models in the future.
...
...
@@ -641,7 +641,7 @@ The process on how to fix the "Not found: Op type not registered" error is a big
我们在[第 2 章](../Text/02.html)和*中使用 TensorFlow 窗格创建了一个基于 Swift 的 iOS 应用,并通过 Transfer Learning* 对图像进行了分类。 现在让我们创建一个新的 Swift 应用程序,该应用程序使用我们在上一节中手动构建的 TensorFlow iOS 库,并在我们的 Swift 应用程序中使用语音命令模型:
我们在第 2 章,*中使用 TensorFlow 窗格创建了一个基于 Swift 的 iOS 应用,并通过 Transfer Learning* 对图像进行了分类。 现在让我们创建一个新的 Swift 应用程序,该应用程序使用我们在上一节中手动构建的 TensorFlow iOS 库,并在我们的 Swift 应用程序中使用语音命令模型:
事实是,当我们处理各种惊人的模型时,我们不得不面对不可避免的问题只是时间问题:我们必须手动为 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.
看看 C ++源代码`tensorflow/contrib/pi_examples/label_image/label_image.cc`和`tensorflow/contrib/pi_examples/camera/camera.cc`,您会看到它们使用与前几章中的 iOS 应用类似的 C ++代码来加载模型图文件,准备输入张量,运行 模型,并获得输出张量。
要运行脚本,请先从[这里](http://download.tensorflow.org/models/speech_commands_v0.01.zip)下载预训练的音频识别模型,然后将其解压缩到`/tmp`,或者对我们在[第 5 章](../Text/05.html)“了解简单语音命令”中使用的模型使用`scp`到 Pi 板的`/tmp`目录,然后运行:
要运行脚本,请先从[这里](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)。