caffe+GAN︱PPGN生成模型5则官方案例(caffe版)
一、效果与架构
PPGN 整合了对抗训练、cnn特征匹配、降噪自编码、Langevin采样;在NIPS2016得到了Ian Goodfellow的介绍.
PPGN生成的图像同类差异化大,可根据指定生成不同类别的图像、多类化,生成的图像清楚分辨率高。
PPGN可使用imagenet1000类分类网络生成特定类别的图像。
效果:
架构图:
详细解读:zdx3578(微信公众号)
二、案例
所需环境:caffe/python/GPU可以加速
确保你是在./caffe/python下运行settings.py
Install ImageMagick command-line interface on your system.
1、案例一:1_class_conditional_sampling.sh
1_class_conditional_sampling.sh: Sampling conditioning on the class “junco” (output unit #13 of the CaffeNet DNNtrained on ImageNet dataset). This script produces a sampling chain for a single given class.
Running ./1_class_conditional_sampling.sh 13 produces this result:
2、2_class_conditional_sampling_many.sh
Running ./2_class_conditional_sampling_many.sh <epsilon1> with different epsilon1 (multiplier for the image prior component) produces a chain with different styles of samples:
3、3_hidden_conditional_sampling.sh
Instead of conditioning on a class, it is possible to condition on a hidden neuron i.e. performing Multifaceted Feature Visualization or synthesizing a set of inputs that highly activate a given neuron to understand what features it has learned to detect.
Running ./3_hidden_conditional_sampling.sh 196 produces a set of images for a conv5 neuron #196 previously identified as a "face detector" in DeepVis toolbox:
4、4_hidden_conditional_sampling_placesCNN.sh
One can repeat the example above but with an arbitrary neuron in a different condition network. Here, we visualize the conv5 neuron #182 in the AlexNet DNN trained on MIT Places205 dataset. This neuron has been previously identified as a “food detector” in Zhou et al [2].
Running ./4_hidden_conditional_sampling_placesCNN.sh 182 produces this result:
5、5_caption_conditional_sampling.sh
We can also replace the image classifier network in previous examples with a pre-trained image captioning network to form a text-to-image model without even re-training anything. The image captioning model in this example is the LRCN model in Donahue et al (2015) [1].
You would need to use the Caffe provided here and update the path to Caffe accordingly in settings.py
The list of words supported are here
Running ./5_caption_conditional_sampling.sh a_church_steeple_that_has_a_clock_on_it produces this result:
caffe+GAN︱PPGN生成模型5则官方案例(caffe版)的更多相关文章
- tflearn kears GAN官方demo代码——本质上GAN是先训练判别模型让你能够识别噪声,然后生成模型基于噪声生成数据,目标是让判别模型出错。GAN的过程就是训练这个生成模型参数!!!
GAN:通过 将 样本 特征 化 以后, 告诉 模型 哪些 样本 是 黑 哪些 是 白, 模型 通过 训练 后, 理解 了 黑白 样本 的 区别, 再输入 测试 样本 时, 模型 就可以 根据 以往 ...
- TensorRT加速 ——NVIDIA终端AI芯片加速用,可以直接利用caffe或TensorFlow生成的模型来predict(inference)
官网:https://developer.nvidia.com/tensorrt 作用:NVIDIA TensorRT™ is a high-performance deep learning inf ...
- GAN︱生成模型学习笔记(运行机制、NLP结合难点、应用案例、相关Paper)
我对GAN"生成对抗网络"(Generative Adversarial Networks)的看法: 前几天在公开课听了新加坡国立大学[机器学习与视觉实验室]负责人冯佳时博士在[硬 ...
- caffe︱cifar-10数据集quick模型的官方案例
准备拿几个caffe官方案例用来练习,就看到了caffe中的官方案例有cifar-10数据集.于是练习了一下,在CPU情况下构建quick模型.主要参考博客:liumaolincycle的博客 配置: ...
- GAN实战笔记——第二章自编码器生成模型入门
自编码器生成模型入门 之所以讲解本章内容,原因有三. 生成模型对大多数人来说是一个全新的领域.大多数人一开始接触到的往往都是机器学习中的分类任务--也许因为它们更为直观:而生成模型试图生成看起来很逼真 ...
- 深度|OpenAI 首批研究成果聚焦无监督学习,生成模型如何高效的理解世界(附论文)
本文经机器之心(微信公众号:almosthuman2014)授权转载,禁止二次转载,原文. 选自 Open AI 作者:ANDREJ KARPATHY, PIETER ABBEEL, GREG BRO ...
- ICML 2018 | 从强化学习到生成模型:40篇值得一读的论文
https://blog.csdn.net/y80gDg1/article/details/81463731 感谢阅读腾讯AI Lab微信号第34篇文章.当地时间 7 月 10-15 日,第 35 届 ...
- caffe-windows环境配置(github上官方BVLC/caffe的推荐配置方法详解)
[转载来的文章:如有侵权,请联系我!我将马上删除!] 首先声明一下,如标题,本教程是caffe在windows系统上的配置方法,而且是github上官方BVLC/caffe目前推荐的配置方法,并不是使 ...
- 【机器学习PAI实战】—— 玩转人工智能之利用GAN自动生成二次元头像
前言 深度学习作为人工智能的重要手段,迎来了爆发,在NLP.CV.物联网.无人机等多个领域都发挥了非常重要的作用.最近几年,各种深度学习算法层出不穷, Generative Adverarial Ne ...
随机推荐
- 提取位于<title>...</title>内的文本标题内容
#vim title.txt <title>nhlinkin</title> # cat title.txt | sed 's:.*<title>\([^< ...
- 细数Python Flask微信公众号开发中遇到的那些坑
最近两三个月的时间,断断续续边学边做完成了一个微信公众号页面的开发工作.这是一个快递系统,主要功能有用户管理.寄收件地址管理.用户下单,订单管理,订单查询及一些宣传页面等.本文主要细数下开发过程中遇到 ...
- 解决axios传递参数后台无法接收问题
1.根据下面几个方法改变前台传递参数方式 这样后台就可以直接根据传递的参数获取数据,如下图用户登录时直接传递用户名和密码 2.不改变前台传递样式修改后台接收方式
- php动态编辑zlib扩展
linux系统上,在php已经编译安装的情况下,启用zlib扩展不是那么容易,需要动态编译 以下是编译步骤: cd ./ext/zlib mv config0.m4 config.m4 /usr/lo ...
- 玩转spring boot——国际化
前言 在项目开发中,可能遇到国际化的问题,而支持国际化却是一件很头疼的事.但spring boot给出了一个非常理想和方便的方案. 一.准备工作 pom.xml: <?xml version=& ...
- ABP官方文档翻译 8.2 SignalR集成
SignalR集成 介绍 安装 服务器端 客户端 建立连接 內建特征 通知 在线客户端 PascalCase与CamelCase对比 你的SignalR代码 介绍 ABP中的Abp.Web.Signa ...
- SpringMVC源码情操陶冶-InterceptorsBeanDefinitionParser拦截器解析器
解析mvc:interceptors节点 观察下InterceptorsBeanDefinitionParser的源码备注 /** * {@link org.springframework.beans ...
- 洛谷 [P2764]最小路径覆盖问题
二分图应用模版 #include <iostream> #include <cstdio> #include <algorithm> #include <cs ...
- 洛谷 [P1801] 黑匣子
这道题是一道splay裸题,然而身为蒟蒻的我并不会,所以这道题我维护的是一个大根堆与一个小根堆结合起来的类似沙漏的结构. 本题难点在于询问的不是最大最小值,而是第K小值,所以我们想到了维护这样两个堆, ...
- CCF NOI plus 201(7)6 初赛题 解题报告
GTMDCCF. 今年这题怎么评价? 去看我在知乎的回答:https://www.zhihu.com/question/66621360/answer/244222388 挨个说一遍. 单项选择题 T ...