JGAN

JGAN

Jittor框架上27种GAN模型的实现与加速对比

JGAN项目在Jittor深度学习框架上实现了27种经典生成对抗网络(GAN)模型,包括ACGAN、CycleGAN和DCGAN等。相比PyTorch,这些模型平均加速185%,最高达283%。项目提供详细使用说明和性能对比数据,为GAN研究和应用开发提供全面的模型库支持。

GANJittorPyTorch深度学习人工智能Github开源项目

JGAN

我们的 GAN 模型库支持 27 种 GAN。 这个表格是我们从 Google Scholar 中找到的最新引用数据。 可以看到,自 2014 年 GAN 被提出以来,出现了许多基于 GAN 的优秀工作。 这 27 种 GAN 总共获得了 60953 次引用,平均每篇文章被引用 2176 次。

我们的 GAN 模型库支持 27 种 GAN 模型。该表是我们从 Google Scholar 中找到的最新引用量。可以看到,自 2014 年提出 GAN 以来,出现了很多基于 GAN 的优秀工作。这 27 个 GAN 模型总共有 60953 次引用,平均每篇文章被引用 2176 次。

<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/16a46a7f-199c-4064-8d20-0989f90b1ec2.png"\> </p>

我们比较了 Jittor 和 PyTorch 这些 GAN 的性能。PyTorch 版本代码使用了 GitHub 仓库 master 分支 2019 年 8 月 24 日的 commit a163b8。下图展示了 Jittor 相对于 PyTorch 的加速比。可以看出,这些 GAN 的最高加速比达到 283%,平均加速比为 185%。

我们比较了 Jittor 和 Pytorch 的这些 GAN 模型的性能。PyTorch 版本代码使用 github 仓库 master 分支 2019 年 8 月 24 日的 commit a163b8。下图是 Jittor 相对于 Pytorch 的加速比。可以看出,这些GANs的最高加速比达到283%,平均加速比为185%。

<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/d682914e-ad68-4322-adc9-1d2928431e75.png"\> </p>

用另一种方式呈现,假设 PyTorch 的训练时间为 100 小时,我们计算了 Jittor 对应的 GAN 训练所需时间。在这些 GAN 中,我们加速最快的 GAN 仅需 35 小时即可运行,平均运行时间为 57 小时。

以另一种形式的呈现,假设 Pytorch 的训练时间为 100 小时,我们计算了 Jittor 对应的 GAN 训练所需的时间。在这些 GAN 中,我们最快的加速 GAN 仅需 35 小时即可运行,平均为 57 小时。

<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/bf014a27-1e0f-4fab-b2e2-c64bb70e7e26.png"\> </p>

新闻

  • 第二届计图人工智能挑战赛已于2022年4月15日正式开启。
  • 计图(Jittor)人工智能算法挑战赛是在国家自然科学基金委信息科学部指导下,由北京信息科学与技术国家研究中心和清华大学-腾讯互联网创新技术联合实验室于2021年创办、基于清华大学"计图"深度学习框架的人工智能算法大赛。从今年开始,该赛事将作为中国软件开源创新大赛中开源任务挑战赛的一部分开展AI算法竞赛。
  • 大赛面向所有在校学生和AI相关领域从业人士开放,旨在通过竞技的方式提升人们对数据分析与处理的算法研究与技术应用的能力,推动我国自主人工智能平台的生态建设和人工智能研究及应用的深入。竞赛得到腾讯公司的赞助。
  • 本届挑战赛设置一个热身赛(手写数字生成赛题)和两个正式赛题(风景图片生成赛题和可微渲染新视角生成赛题),参赛选手需要通过热身赛才能参加两个正式赛题。比赛更多信息可以在官网查看。其中计图挑战热身赛和赛题一:风景图片生成赛题可以详见这里

目录

安装

$ git clone https://github.com/Jittor/JGAN.git
$ cd JGAN/
$ sudo python3.7 -m pip install -r requirements.txt

模型

辅助分类器生成对抗网络

辅助分类器生成对抗网络

作者

Augustus Odena, Christopher Olah, Jonathon Shlens

[论文] [代码]

运行示例

$ cd models/acgan/
$ python3.7 acgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/971f1dae-3c88-4253-8ae2-e0de4e7c214a.png" width="200"\> </p>

对抗自编码器

对抗自编码器

作者

Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, Brendan Frey

[论文] [代码]

运行示例

$ cd models/aae/
$ python3.7 aae.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/53db459c-9de0-4db6-9627-254e6713ca8e.gif" width="200"\> </p>

BEGAN

BEGAN: 边界均衡生成对抗网络

作者

David Berthelot, Thomas Schumm, Luke Metz

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/began/began.py

运行示例

$ cd models/began/
$ python3.7 began.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/94c625e5-901a-4959-bfb2-25e9e8e398a2.gif" width="200"\> </p>

BicycleGAN

多模态图像到图像转换

作者

Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A. Efros, Oliver Wang, Eli Shechtman

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/bicyclegan/bicyclegan.py

运行示例

$ cd data/
$ bash download_pix2pix_dataset.sh edges2shoes
$ cd ../models/bicyclegan/
$ python3.7 bicyclegan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/a72ee94b-a266-4af6-9d6f-d85de5300cc3.png" width="400"\> </p> <p align="center"> 通过改变潜在编码实现各种风格转换。 </p>

边界寻求GAN

边界寻求生成对抗网络

作者

R Devon Hjelm, Athul Paul Jacob, Tong Che, Adam Trischler, Kyunghyun Cho, Yoshua Bengio

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/bgan/bgan.py

运行示例

$ cd models/bgan/
$ python3.7 bgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/c9d9baf6-5958-4376-a0b3-8d191aefab20.png" width="240"\> </p>

聚类GAN

ClusterGAN:生成对抗网络中的潜在空间聚类

作者

Sudipto Mukherjee, Himanshu Asnani, Eugene Lin, Sreeram Kannan

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/cluster_gan/clustergan.py

运行示例

$ cd models/cluster_gan/
$ python3.7 clustergan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/3dd07852-3971-4128-87e0-20786193bf5e.png" width="200"\> </p>

条件GAN

条件生成对抗网络

作者

Mehdi Mirza, Simon Osindero

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/cgan/cgan.py

运行示例

$ cd models/cgan/
$ python3.7 cgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/bd668704-e143-4f0b-b621-844d413f522d.gif" width="200"\> </p>

上下文编码器

上下文编码器:通过修复学习特征

作者

Deepak Pathak, Philipp Krahenbuhl, Jeff Donahue, Trevor Darrell, Alexei A. Efros

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/context_encoder/context_encoder.py

运行示例

$ cd models/context_encoder/
<按照context_encoder.py顶部的步骤操作>
$ python3.7 context_encoder.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/feffab86-3ba4-4471-abb8-67bdfdb0c277.png" width="640"\> </p> <p align="center"> 行:遮罩 | 修复 | 原图 | 遮罩 | 修复 | 原图 </p>

耦合GAN

耦合生成对抗网络

作者

Ming-Yu Liu, Oncel Tuzel [论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/cogan/cogan.py

运行示例

$ 从 https://cloud.tsinghua.edu.cn/f/d9a411da271745fcbe1f/?dl=1 下载 mnistm.pkl 并将其放入 data/mnistm/mnistm.pkl
$ cd models/cogan/
$ python3.7 cogan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/007f4eb8-a06e-4657-93a3-1a8341a35be5.gif" width="200"\> </p> <p align="center"> 生成的 MNIST 和 MNIST-M 图像 </p>

CycleGAN

使用循环一致对抗网络进行非配对图像到图像的转换

作者

Jun-Yan Zhu, Taesung Park, Phillip Isola, Alexei A. Efros

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/cyclegan/cyclegan.py

运行示例

$ cd data/
$ bash download_cyclegan_dataset.sh monet2photo
$ cd ../models/cyclegan/
$ python3.7 cyclegan.py --dataset_name monet2photo
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/5c41ebb4-cf3d-419f-a91a-70b9dff723dc.png" width="400"\> </p> <p align="center"> 莫奈风格到照片的转换 </p>

深度卷积GAN

深度卷积生成对抗网络

作者

Alec Radford, Luke Metz, Soumith Chintala

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/dcgan/dcgan.py

运行示例

$ cd models/dcgan/
$ python3.7 dcgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/a20a6ad0-8451-4b1c-b9c6-669365c96af4.png" width="240"\> </p>

DRAGAN

关于GAN的收敛性和稳定性

作者

Naveen Kodali, Jacob Abernethy, James Hays, Zsolt Kira

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/dragan/dragan.py

运行示例

$ cd models/dragan/
$ python3.7 dragan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/009f006d-1c6d-4413-9211-f1c2625abf64.png" width="240"\> </p>

基于能量的GAN

基于能量的生成对抗网络

作者

Junbo Zhao, Michael Mathieu, Yann LeCun

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/ebgan/ebgan.py

运行示例

$ cd models/ebgan/
$ python3.7 ebgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/4a23882d-7ccd-4e95-9338-73789a69114d.png" width="240"\> </p>

增强型超分辨率GAN

ESRGAN:增强型超分辨率生成对抗网络

作者

Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Chen Change Loy, Yu Qiao, Xiaoou Tang

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/esrgan/esrgan.py

运行示例

$ cd models/esrgan/
<按照esrgan.py顶部的步骤操作>
$ python3.7 esrgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/f55a4e8c-1704-45a8-9901-c7f2644f2c5c.gif" width="320"\> </p>

GAN

生成对抗网络

作者

Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/gan/gan.py

运行示例

$ cd models/gan/
$ python3.7 gan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/b78f70aa-3a94-4af3-9bcf-63ef60d1d70f.png" width="240"\> </p>

InfoGAN

InfoGAN:通过信息最大化生成对抗网络实现可解释表示学习

作者

Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, Pieter Abbeel

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/infogan/infogan.py

运行示例

$ cd models/infogan/
$ python3.7 infogan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/ec5ed7b0-7c9e-42a3-ad1f-c0af569ffc0c.png" width="200"\> </p> <p align="center"> 按行变化连续潜在变量的结果。 </p>

最小二乘GAN

最小二乘生成对抗网络

作者

Xudong Mao, Qing Li, Haoran Xie, Raymond Y.K. Lau, Zhen Wang, Stephen Paul Smolley

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/lsgan/lsgan.py

运行示例

$ cd models/lsgan/
$ python3.7 lsgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/01ba5dfc-6c7a-4b29-be45-7b6e7612dd81.png" width="200"\> </p>

Pix2Pix

使用条件对抗网络的非配对图像到图像转换

作者

Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, Alexei A. Efros

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/pix2pix/pix2pix.py

运行示例

$ cd data/
$ bash download_pix2pix_dataset.sh facades
$ cd ../models/pix2pix/
$ python3.7 pix2pix.py --dataset_name facades
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/a67f2aa5-fb8c-4481-98fb-76d93219c7a2.png" width="240"\> </p> <p align="center">
从上到下的行依次为:(1) 生成器的条件 (2) 基于条件生成的图像 <br>
(3) 与条件相对应的真实图像
</p>

PixelDA

使用生成对抗网络的无监督像素级域适应

作者

Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, Dilip Krishnan

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/pixelda/pixelda.py

MNIST到MNIST-M分类

训练一个分类器,使用从源域(MNIST)转换到目标域(MNIST-M)的图像,并使用源域图像的标注。分类网络与生成器网络联合训练,以优化生成器既能提供适当的域转换,又能保留源域图像的语义。在转换后的图像上训练的分类网络与直接在MNIST上训练并在MNIST-M上评估的朴素解决方案进行比较。朴素模型在MNIST-M上实现55%的分类准确率,而在域适应过程中训练的模型达到95%的分类准确率。

$ 从 https://cloud.tsinghua.edu.cn/f/d9a411da271745fcbe1f/?dl=1 下载 mnistm.pkl 并将其放入 data/mnistm/mnistm.pkl
$ cd models/pixelda/
$ python3.7 pixelda.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/e9b07f3a-8f86-4c7a-851a-3b2327f02d2e.gif" width="200"\> </p> <p align="center"> 从上到下的行依次为:(1) MNIST的真实图像 (2) 从MNIST转换到MNIST-M的图像 <br> (3) MNIST-M的示例图像 </p>

相对论GAN

相对论判别器:标准GAN中缺失的关键元素

作者

Alexia Jolicoeur-Martineau

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/relativistic_gan/relativistic_gan.py

运行示例

$ cd models/relativistic_gan/
$ python3.7 relativistic_gan.py                 # 相对论标准GAN
$ python3.7 relativistic_gan.py --rel_avg_gan   # 相对论平均GAN
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/d05c04e1-fe70-4995-b6fb-73631f1dd932.png" width="240"\> </p>

半监督生成对抗网络

半监督生成对抗网络

作者

Augustus Odena

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/sgan/sgan.py

运行示例

$ cd models/sgan/
$ python3.7 sgan.py

Softmax 生成对抗网络

Softmax 生成对抗网络

作者

Min Lin

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/softmax_gan/softmax_gan.py

运行示例

$ cd models/softmax_gan/
$ python3.7 softmax_gan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/b043f92e-4ec0-4bda-885e-0e444eda31f6.png" width="240"\> </p>

StarGAN

StarGAN:用于多域图像到图像转换的统一生成对抗网络

作者

Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, Jaegul Choo

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/stargan/stargan.py

运行示例

$ cd models/stargan/
<按照stargan.py顶部的步骤操作>
$ python3.7 stargan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/9410b90c-9263-4e93-a212-8185fa6180de.png" width="240"\> </p> <p align="center">
原始 | 黑发 | 金发 | 棕发 | 性别翻转 | 变老
</p>

UNIT

无监督图像到图像转换网络

作者

Ming-Yu Liu, Thomas Breuel, Jan Kautz

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/unit/unit.py

运行示例

$ cd data/
$ bash download_cyclegan_dataset.sh apple2orange
$ cd models/unit/
$ python3.7 unit.py --dataset_name apple2orange

Wasserstein GAN

Wasserstein 生成对抗网络

作者

Martin Arjovsky, Soumith Chintala, Léon Bottou

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/wgan/wgan.py

运行示例

$ cd models/wgan/
$ python3.7 wgan.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/51489852-e2ba-4fa9-ba54-da961a10e899.png" width="240"\> </p>

Wasserstein GAN GP

改进的Wasserstein GAN训练

作者

Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, Aaron Courville

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/wgan_gp/wgan_gp.py

运行示例

$ cd models/wgan_gp/
$ python3.7 wgan_gp.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/43ce84a3-7861-4cb3-b26c-897f574baec2.png" width="240"\> </p>

Wasserstein GAN DIV

GAN的Wasserstein散度

作者

Jiqing Wu, Zhiwu Huang, Janine Thoma, Dinesh Acharya, Luc Van Gool

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/wgan_div/wgan_div.py

运行示例

$ cd models/wgan_div/
$ python3.7 wgan_div.py
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/c09300ab-782b-4471-935b-d0db8642c322.gif" width="240"\> </p>

StyleGAN2

GAN的Wasserstein散度

作者

Jiqing Wu, Zhiwu Huang, Janine Thoma, Dinesh Acharya, Luc Van Gool

[论文] [[代码]](https://github.com/Jittor/JGAN/blob/master/models/wgan_div/wgan_div.py

运行示例

$ cd models/StyleGAN2
<p align="center"> <img src="https://yellow-cdn.veclightyear.com/0a4dffa0/a2e3acfd-7fe3-4d2c-88a4-d13af249c6c2.png" \> </p>

编辑推荐精选

TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

Keevx

Keevx

AI数字人视频创作平台

Keevx 一款开箱即用的AI数字人视频创作平台,广泛适用于电商广告、企业培训与社媒宣传,让全球企业与个人创作者无需拍摄剪辑,就能快速生成多语言、高质量的专业视频。

即梦AI

即梦AI

一站式AI创作平台

提供 AI 驱动的图片、视频生成及数字人等功能,助力创意创作

扣子-AI办公

扣子-AI办公

AI办公助手,复杂任务高效处理

AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!

蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
下拉加载更多