提交 ab5d34a1 编写于 作者: W wizardforcel

2020-08-13 23:29:08

上级 11b56f41
......@@ -349,7 +349,7 @@ An example of train and test accuracy increase
# 创建一个 ConvNet 对 CIFAR-10 进行分类
在本食谱中,您将学习如何对从 CIFAR-10 拍摄的图像进行分类。 CIFAR-10 数据集由 10 类 60,000 张 32 x 32 彩色图像组成,每类 6,000 张图像。 有 50,000 张训练图像和 10,000 张测试图像。 下图取自 [https://www.cs.toronto.edu/~kriz/cifar.html](https://www.cs.toronto.edu/~kriz/cifar.html)
在本食谱中,您将学习如何对从 CIFAR-10 拍摄的图像进行分类。 CIFAR-10 数据集由 10 类 60,000 张 32 x 32 彩色图像组成,每类 6,000 张图像。 有 50,000 张训练图像和 10,000 张测试图像。 下图取自[这里](https://www.cs.toronto.edu/~kriz/cifar.html)
![](img/e76fb54a-9f96-476b-9727-dec2492cc2a8.png)
......@@ -357,7 +357,7 @@ Examples of CIFAR images
# 做好准备
在本食谱中,我们使用`tflearn`-一个更高级别的框架-抽象了一些 TensorFlow 内部结构,使我们可以专注于深度网络的定义。 TFLearn 可从 [http://tflearn.org/](http://tflearn.org/) 获得,该代码是标准发行版的一部分。 ( [https://github.com/tflearn/tflearn/tree/master/examples](https://github.com/tflearn/tflearn/tree/master/examples)
在本食谱中,我们使用`tflearn`-一个更高级别的框架-抽象了一些 TensorFlow 内部结构,使我们可以专注于深度网络的定义。 TFLearn 可从[这里](http://tflearn.org/)获得,[该代码是标准发行版的一部分](https://github.com/tflearn/tflearn/tree/master/examples)
# 怎么做...
......@@ -444,15 +444,15 @@ An example of Jupyter execution for CIFAR10 classification
# 还有更多...
要安装 TFLearn,请参阅《安装指南》( [http://tflearn.org/installation](http://tflearn.org/installation) ),如果您想查看更多示例,可以在线获取一长串已煮熟的解决方案( [http ://tflearn.org/examples/](http://tflearn.org/examples/)
要安装 TFLearn,请参阅[《安装指南》](http://tflearn.org/installation),如果您想查看更多示例,可以在线获取[一长串久经考验的解决方案](http://tflearn.org/examples/)
# 使用 VGG19 传输样式以进行图像重绘
在本食谱中,您将教计算机如何绘画。 关键思想是拥有绘画模型图像,神经网络可以从该图像推断绘画风格。 然后,此样式将转移到另一张图片,并相应地重新粉刷。 该食谱是对 log0 开发的代码的修改,可以在线获取( [https://github.com/log0/neural-style-painting/blob/master/TensorFlow%20Implementation%20of%20A%20Neural%20Algorithm% 20of%20Artistic%20Style.ipynb](https://github.com/log0/neural-style-painting/blob/master/TensorFlow%20Implementation%20of%20A%20Neural%20Algorithm%20of%20Artistic%20Style.ipynb)
在本食谱中,您将教计算机如何绘画。 关键思想是拥有绘画模型图像,神经网络可以从该图像推断绘画风格。 然后,此样式将转移到另一张图片,并相应地重新粉刷。 该食谱是对 log0 开发的代码的修改,[可以在线获取](https://github.com/log0/neural-style-painting/blob/master/TensorFlow%20Implementation%20of%20A%20Neural%20Algorithm%20of%20Artistic%20Style.ipynb)
# 做好准备
我们将实现在论文[《一种艺术风格的神经算法》](https://arxiv.org/abs/1508.06576)中描述的算法,作者是 Leon A. Gatys,亚历山大 S. Ecker 和 Matthias Bethge。 因此,最好先阅读该论文( [https://arxiv.org/abs/1508.06576](https://arxiv.org/abs/1508.06576) )。 此食谱将重复使用在线提供的预训练模型 VGG19( [http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat](http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat) ),该模型应在本地下载。 我们的风格图片将是一幅可在线获得的梵高著名画作( [https://commons.wikimedia.org/wiki/File:VanGogh-starry_night.jpg](https://commons.wikimedia.org/wiki/File:VanGogh-starry_night.jpg) ),而我们的内容图片则是玛丽莲(Marilyn)的照片 从 Wikipedia( [https://commons.wikimedia.org/wiki/File:Marilyn_Monroe_in_1952.jpg](https://commons.wikimedia.org/wiki/File:Marilyn_Monroe_in_1952.jpg) )下载的梦露。 内容图像将根据梵高的样式重新粉刷
我们将实现在论文[《一种艺术风格的神经算法》](https://arxiv.org/abs/1508.06576)中描述的算法,作者是 Leon A. Gatys,亚历山大 S. Ecker 和 Matthias Bethge。 因此,最好先阅读[该论文](https://arxiv.org/abs/1508.06576)。 此食谱将重复使用在线提供的预训练模型 [VGG19](http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat),该模型应在本地下载。 我们的风格图片将是一幅可在线获得的[梵高著名画作](https://commons.wikimedia.org/wiki/File:VanGogh-starry_night.jpg),而我们的内容图片则是[从维基百科下载的玛丽莲梦露的照片](https://commons.wikimedia.org/wiki/File:Marilyn_Monroe_in_1952.jpg)。 内容图像将根据梵高的样式重新绘制
# 怎么做...
......@@ -506,7 +506,7 @@ VGG_MODEL = 'data/imagenet-vgg-verydeep-19.mat'
content_image = scipy.misc.imread(CONTENT_IMAGE) imshow(content_image)
```
这是前面代码的输出(请注意,此图像位于 [https://commons.wikimedia.org/wiki/File:Marilyn_Monroe_in_1952.jpg](https://commons.wikimedia.org/wiki/File:Marilyn_Monroe_in_1952.jpg) 中):
这是前面代码的输出(请注意,此图像位于[这个页面](https://commons.wikimedia.org/wiki/File:Marilyn_Monroe_in_1952.jpg)中):
![](img/359c23f6-f761-4df1-9542-0234e69e01d0.png)
......@@ -859,15 +859,15 @@ An example of style transfer
自 2015 年提出原始建议以来,样式转换一直是活跃的研究领域。已经提出了许多新想法来加速计算并将样式转换扩展到视频分析。 其中有两个结果值得一提
这篇文章是 Logan Engstrom [https://github.com/lengstrom/fast-style-transfer/](https://github.com/lengstrom/fast-style-transfer/) 的快速样式转换,介绍了一种非常快速的实现,该实现也可以与视频一起使用。
这篇文章是 [Logan Engstrom](https://github.com/lengstrom/fast-style-transfer/) 的快速样式转换,介绍了一种非常快速的实现,该实现也可以与视频一起使用。
通过 [https://deepart.io/](https://deepart.io/) 网站,您可以播放自己的图像,并以自己喜欢的艺术家的风格重新绘制图片。 还提供了 Android 应用程序,iPhone 应用程序和 Web 应用程序。
通过 [deepart](https://deepart.io/) 网站,您可以播放自己的图像,并以自己喜欢的艺术家的风格重新绘制图片。 还提供了 Android 应用程序,iPhone 应用程序和 Web 应用程序。
# 使用预训练的 VGG16 网络进行迁移学习
在本食谱中,我们将讨论转移学习,这是一种非常强大的深度学习技术,在不同领域中都有许多应用程序。 直觉非常简单,可以用类推来解释。 假设您想学习一种新的语言,例如西班牙语,那么从另一种语言(例如英语)已经知道的内容开始可能会很有用。
按照这种思路,计算机视觉研究人员现在通常使用经过预训练的 CNN 来生成新颖任务的表示形式,其中数据集可能不足以从头训练整个 CNN。 另一个常见的策略是采用经过预先训练的 ImageNet 网络,然后将整个网络微调到新颖的任务。 此处提出的示例的灵感来自 Francois Chollet 在 Keras 的著名博客文章中的灵感。 ( [https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html](https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html)
按照这种思路,计算机视觉研究人员现在通常使用经过预训练的 CNN 来生成新颖任务的表示形式,其中数据集可能不足以从头训练整个 CNN。 另一个常见的策略是采用经过预先训练的 ImageNet 网络,然后将整个网络微调到新颖的任务。 此处提出的示例的灵感来自 [Francois Chollet 在 Keras 的著名博客文章](https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html)
# 做好准备
......@@ -998,7 +998,7 @@ scores = model.predict_generator(validation_generator, nb_validation_samples/bat
#取消冻结`model.layers`中所有较低层的图层:`layer.trainable = True`
* 如果新数据集与 ImageNet 数据集非常不同,则在实践中,使用预训练模型中的权重进行初始化可能仍然很好。 在这种情况下,我们将有足够的数据和信心来调整整个网络。 可以在 [http://cs231n.github.io/transfer-learning/](http://cs231n.github.io/transfer-learning/) 在线找到更多信息。
* 如果新数据集与 ImageNet 数据集非常不同,则在实践中,使用预训练模型中的权重进行初始化可能仍然很好。 在这种情况下,我们将有足够的数据和信心来调整整个网络。 可以在[这里](http://cs231n.github.io/transfer-learning/)在线找到更多信息。
# 创建 DeepDream 网络
......@@ -1010,7 +1010,7 @@ An example of Google Deep Dreams as seen in [https://commons.wikimedia.org/wiki/
# 做好准备
从网上下载预训练的 Inception 模型( [https://github.com/martinwicke/tensorflow-tutorial/blob/master/tensorflow_inception_graph.pb](https://github.com/martinwicke/tensorflow-tutorial/blob/master/tensorflow_inception_graph.pb)
从网上下载预训练的 [Inception 模型](https://github.com/martinwicke/tensorflow-tutorial/blob/master/tensorflow_inception_graph.pb)
# 怎么做...
......@@ -1150,7 +1150,7 @@ An example of Deep Dream transformation. One of the authors transformed into a w
# 还有更多...
许多网站都允许您直接玩 DeepDreaming。 我特别喜欢`DeepArt.io`[https://deepart.io/](https://deepart.io/),它允许您上传内容图像和样式图像并在云上进行学习。
许多网站都允许您直接玩 DeepDreaming。 我特别喜欢[`DeepArt.io`](https://deepart.io/),它允许您上传内容图像和样式图像并在云上进行学习。
# 也可以看看
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册