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 ...
随机推荐
- GO开发:用go写个日志监控系统
日志收集系统架构 1.项目背景 a. 每个系统都有日志,当系统出现问题时,需要通过日志解决问题 b. 当系统机器比较少时,登陆到服务器上查看即可满足 c. 当系统机器规模巨大,登陆到机器上查看几乎不现 ...
- JavaBean,List,Map,json格式之间转化方式
public class TestBean { private String id; private String name; private String password; public Stri ...
- 怎么改变title属性的样式?
我们经常会设置title属性来显示提示的内容,最常见的一种就是超过文本框的内容显示省略号,鼠标移上去显示完整的内容,这里顺便说下显示省略号的设置,如 div{text-overflow:ellipsi ...
- 扩展 KMP
扩展KMP解决这样一些问题: 给定两个字符串 S 和 T(长度分别为 n 和 m),下标从 0 开始,定义extend[i]等于S[i]...S[n-1]与 T 的最长相同前缀的长度,求出所有的ext ...
- 【转】PE详解
参考网址: http://blog.tianya.cn/listcate-4259222-2269876-1.shtml PE文件
- xftp上传失败之解决办法
修改/usr/local 文件夹权限 rwx 为不可读不可写第三方不可访问 报错 传输状态 恢复文件夹/usr/local 读写第三方访问权限 成功上传
- Git点滴记录
合并多个commit记录 假设我们当前有三个commit信息,现在要将commit hash为 23f92c 和 409978 合并 //git rebase -i HEAD~3 那么我们可以使用 r ...
- fatal error C1083:无法打开包括文件:“stdint.h”: No such file or directory解决方案
stdint.h文件是C99的标准头文件,默认情况下VC是不支持的,所以在使用过程中肯定会碰到 "No such file or directory"的问题. 解决办法 1.从网盘 ...
- Java实现单链表的快速排序和归并排序
本文描述了LeetCode 148题 sort-list 的解法. 题目描述如下: Sort a linked list in O(n log n) time using constant space ...
- main函数的实现解析
main函数的传参的实现,其实也是一个解析字符串的过程:将每个word后一个空格改为“/0”,将单词提取出来. 就是这么简单. 废话不多说,直接上代码: #include<stdio.h> ...