[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-znxlwm--pytorch-generative-model-collections":3,"tool-znxlwm--pytorch-generative-model-collections":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",154349,2,"2026-04-13T23:32:16",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":76,"owner_email":78,"owner_twitter":76,"owner_website":76,"owner_url":79,"languages":80,"stars":85,"forks":86,"last_commit_at":87,"license":76,"difficulty_score":10,"env_os":88,"env_gpu":89,"env_ram":88,"env_deps":90,"category_tags":94,"github_topics":95,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":112,"updated_at":113,"faqs":114,"releases":135},7272,"znxlwm\u002Fpytorch-generative-model-collections","pytorch-generative-model-collections","Collection of generative models in Pytorch version.","pytorch-generative-model-collections 是一个基于 PyTorch 框架的开源项目，汇集了多种主流生成对抗网络（GAN）的代码实现。该项目参考了经典的 TensorFlow 版本库进行了重构，旨在为研究者提供一个统一、便捷的实验平台，解决了不同 GAN 变体代码风格各异、难以横向对比的痛点。\n\n它内置了包括基础 GAN、LSGAN、WGAN 及其改进版（WGAN_GP）、DRAGAN，以及条件生成模型（CGAN、ACGAN）和信息最大化模型（InfoGAN）等十种经典算法。为了确保公平比较核心思想，项目在 MNIST 和 Fashion-MNIST 数据集上保持了生成器与判别器架构的高度一致性（除需自编码器结构的变体外），并提供了从训练到生成固定噪声图像的完整复现脚本。\n\n这款工具特别适合人工智能研究人员、深度学习开发者以及高校学生使用。对于希望深入理解 GAN 数学原理、快速验证新想法或进行算法性能基准测试的用户而言，它省去了重复编写基础架构的时间。虽然支持 CPU 模式，但建议在 GPU 环境下运行以获得最佳体验。通过标准化的代码结构，pytorc","pytorch-generative-model-collections 是一个基于 PyTorch 框架的开源项目，汇集了多种主流生成对抗网络（GAN）的代码实现。该项目参考了经典的 TensorFlow 版本库进行了重构，旨在为研究者提供一个统一、便捷的实验平台，解决了不同 GAN 变体代码风格各异、难以横向对比的痛点。\n\n它内置了包括基础 GAN、LSGAN、WGAN 及其改进版（WGAN_GP）、DRAGAN，以及条件生成模型（CGAN、ACGAN）和信息最大化模型（InfoGAN）等十种经典算法。为了确保公平比较核心思想，项目在 MNIST 和 Fashion-MNIST 数据集上保持了生成器与判别器架构的高度一致性（除需自编码器结构的变体外），并提供了从训练到生成固定噪声图像的完整复现脚本。\n\n这款工具特别适合人工智能研究人员、深度学习开发者以及高校学生使用。对于希望深入理解 GAN 数学原理、快速验证新想法或进行算法性能基准测试的用户而言，它省去了重复编写基础架构的时间。虽然支持 CPU 模式，但建议在 GPU 环境下运行以获得最佳体验。通过标准化的代码结构，pytorch-generative-model-collections 让探索图像生成的奥秘变得更加简单高效。","# pytorch-generative-model-collections\nOriginal : [[Tensorflow version]](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)\n\nPytorch implementation of various GANs.\n\nThis repository was re-implemented with reference to [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections) by [Hwalsuk Lee](https:\u002F\u002Fgithub.com\u002Fhwalsuklee)\n\nI tried to implement this repository as much as possible with [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections), But some models are a little different.\n\nThis repository is included code for CPU mode Pytorch, but i did not test. I tested only in GPU mode Pytorch.\n\n## Dataset\n\n- MNIST\n- Fashion-MNIST\n- CIFAR10\n- SVHN\n- STL10\n- LSUN-bed\n#### I only tested the code on MNIST and Fashion-MNIST.\n\n## Generative Adversarial Networks (GANs)\n### Lists (Table is borrowed from [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections))\n\n*Name* | *Paper Link* | *Value Function*\n:---: | :---: | :--- |\n**GAN** | [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1406.2661) | \u003Cimg src = 'assets\u002Fequations\u002FGAN.png' height = '70px'>\n**LSGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1611.04076) | \u003Cimg src = 'assets\u002Fequations\u002FLSGAN.png' height = '70px'>\n**WGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1701.07875) | \u003Cimg src = 'assets\u002Fequations\u002FWGAN.png' height = '105px'>\n**WGAN_GP**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.00028) | \u003Cimg src = 'assets\u002Fequations\u002FWGAN_GP.png' height = '70px'>\n**DRAGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1705.07215) | \u003Cimg src = 'assets\u002Fequations\u002FDRAGAN.png' height = '70px'>\n**CGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1411.1784) | \u003Cimg src = 'assets\u002Fequations\u002FCGAN.png' height = '70px'>\n**infoGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1606.03657) | \u003Cimg src = 'assets\u002Fequations\u002FinfoGAN.png' height = '70px'>\n**ACGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1610.09585) | \u003Cimg src = 'assets\u002Fequations\u002FACGAN.png' height = '70px'>\n**EBGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1609.03126) | \u003Cimg src = 'assets\u002Fequations\u002FEBGAN.png' height = '70px'>\n**BEGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.10717) | \u003Cimg src = 'assets\u002Fequations\u002FBEGAN.png' height = '105px'>  \n\n#### Variants of GAN structure (Figures are borrowed from [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections))\n\u003Cimg src = 'assets\u002Fetc\u002FGAN_structure.png' height = '600px'>\n\n### Results for mnist\nNetwork architecture of generator and discriminator is the exaclty sames as in [infoGAN paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1606.03657).  \nFor fair comparison of core ideas in all gan variants, all implementations for network architecture are kept same except EBGAN and BEGAN. Small modification is made for EBGAN\u002FBEGAN, since those adopt auto-encoder strucutre for discriminator. But I tried to keep the capacity of discirminator.\n\nThe following results can be reproduced with command:  \n```\npython main.py --dataset mnist --gan_type \u003CTYPE> --epoch 50 --batch_size 64\n```\n\n#### Fixed generation\nAll results are generated from the fixed noise vector.\n\n*Name* | *Epoch 1* | *Epoch 25* | *Epoch 50* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_generate_animation.gif' height = '200px'>\nLSGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_generate_animation.gif' height = '200px'>\nWGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_generate_animation.gif' height = '200px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_generate_animation.gif' height = '200px'>\nDRAGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_generate_animation.gif' height = '200px'>\nEBGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_generate_animation.gif' height = '200px'>\nBEGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_generate_animation.gif' height = '200px'>\n\n#### Conditional generation\nEach row has the same noise vector and each column has the same label condition.\n\n*Name* | *Epoch 1* | *Epoch 25* | *Epoch 50* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nCGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_generate_animation.gif' height = '200px'>\nACGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_generate_animation.gif' height = '200px'>\ninfoGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_generate_animation.gif' height = '200px'>\n\n#### InfoGAN : Manipulating two continous codes\nAll results have the same noise vector and label condition, but have different continous vector.\n\n*Name* | *Epoch 1* | *Epoch 25* | *Epoch 50* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\ninfoGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_generate_animation.gif' height = '200px'>\n\n#### Loss plot\n\n*Name* | *Loss*\n:---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_loss.png' height = '230px'>\nLSGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_loss.png' height = '230px'>\nWGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_loss.png' height = '230px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_loss.png' height = '230px'>\nDRAGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_loss.png' height = '230px'>\nEBGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_loss.png' height = '230px'>\nBEGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_loss.png' height = '230px'>\nCGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_loss.png' height = '230px'>\nACGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_loss.png' height = '230px'>\ninfoGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_loss.png' height = '230px'>\n\n### Results for fashion-mnist\nComments on network architecture in mnist are also applied to here.  \n[Fashion-mnist](https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Ffashion-mnist) is a recently proposed dataset consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes. (T-shirt\u002Ftop, Trouser, Pullover, Dress, Coat, Sandal, Shirt, Sneaker, Bag, Ankle boot)\n\nThe following results can be reproduced with command:  \n```\npython main.py --dataset fashion-mnist --gan_type \u003CTYPE> --epoch 50 --batch_size 64\n```\n\n#### Fixed generation\nAll results are generated from the fixed noise vector.\n\n*Name* | *Epoch 1* | *Epoch 25* | *Epoch 50* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_generate_animation.gif' height = '200px'>\nLSGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_generate_animation.gif' height = '200px'>\nWGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_generate_animation.gif' height = '200px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_generate_animation.gif' height = '200px'>\nDRAGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_generate_animation.gif' height = '200px'>\nEBGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_generate_animation.gif' height = '200px'>\nBEGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_generate_animation.gif' height = '200px'>\n\n#### Conditional generation\nEach row has the same noise vector and each column has the same label condition.\n\n*Name* | *Epoch 1* | *Epoch 25* | *Epoch 50* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nCGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_generate_animation.gif' height = '200px'>\nACGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_generate_animation.gif' height = '200px'>\ninfoGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_generate_animation.gif' height = '200px'>\n\n- ACGAN tends to fall into mode-collapse in [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections), but Pytorch ACGAN does not fall into mode-collapse.\n\n#### InfoGAN : Manipulating two continous codes\nAll results have the same noise vector and label condition, but have different continous vector.\n\n*Name* | *Epoch 1* | *Epoch 25* | *Epoch 50* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\ninfoGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_generate_animation.gif' height = '200px'>\n\n#### Loss plot\n\n*Name* | *Loss*\n:---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_loss.png' height = '230px'>\nLSGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_loss.png' height = '230px'>\nWGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_loss.png' height = '230px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_loss.png' height = '230px'>\nDRAGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_loss.png' height = '230px'>\nEBGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_loss.png' height = '230px'>\nBEGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_loss.png' height = '230px'>\nCGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_loss.png' height = '230px'>\nACGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_loss.png' height = '230px'>\ninfoGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_loss.png' height = '230px'>\n\n## Folder structure\nThe following shows basic folder structure.\n```\n├── main.py # gateway\n├── data\n│   ├── mnist # mnist data (not included in this repo)\n│   ├── ...\n│   ├── ...\n│   └── fashion-mnist # fashion-mnist data (not included in this repo)\n│\n├── GAN.py # vainilla GAN\n├── utils.py # utils\n├── dataloader.py # dataloader\n├── models # model files to be saved here\n└── results # generation results to be saved here\n```\n\n## Development Environment\n* Ubuntu 16.04 LTS\n* NVIDIA GTX 1080 ti\n* cuda 9.0\n* Python 3.5.2\n* pytorch 0.4.0\n* torchvision 0.2.1\n* numpy 1.14.3\n* matplotlib 2.2.2\n* imageio 2.3.0\n* scipy 1.1.0\n\n## Acknowledgements\nThis implementation has been based on [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections) and tested with Pytorch 0.4.0 on Ubuntu 16.04 using GPU.\n\n","# PyTorch生成模型合集\n原文：[[TensorFlow版本]](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)\n\n各种GAN的PyTorch实现。\n\n本仓库是在[Hwalsuk Lee](https:\u002F\u002Fgithub.com\u002Fhwalsuklee)的[tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)的基础上重新实现的。\n\n我尽量按照[tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)来实现，但部分模型仍有一些差异。\n\n本仓库包含了CPU模式下的PyTorch代码，但我并未进行测试。我仅在GPU模式下对PyTorch代码进行了测试。\n\n## 数据集\n\n- MNIST\n- Fashion-MNIST\n- CIFAR10\n- SVHN\n- STL10\n- LSUN-bed\n#### 我只在MNIST和Fashion-MNIST上测试了代码。\n\n## 生成对抗网络（GANs）\n### 列表（表格引用自[tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)）\n\n*名称* | *论文链接* | *目标函数*\n:---: | :---: | :---:\n**GAN** | [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1406.2661) | \u003Cimg src = 'assets\u002Fequations\u002FGAN.png' height = '70px'>\n**LSGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1611.04076) | \u003Cimg src = 'assets\u002Fequations\u002FLSGAN.png' height = '70px'>\n**WGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1701.07875) | \u003Cimg src = 'assets\u002Fequations\u002FWGAN.png' height = '105px'>\n**WGAN_GP**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.00028) | \u003Cimg src = 'assets\u002Fequations\u002FWGAN_GP.png' height = '70px'>\n**DRAGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1705.07215) | \u003Cimg src = 'assets\u002Fequations\u002FDRAGAN.png' height = '70px'>\n**CGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1411.1784) | \u003Cimg src = 'assets\u002Fequations\u002FCGAN.png' height = '70px'>\n**infoGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1606.03657) | \u003Cimg src = 'assets\u002Fequations\u002FinfoGAN.png' height = '70px'>\n**ACGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1610.09585) | \u003Cimg src = 'assets\u002Fequations\u002FACGAN.png' height = '70px'>\n**EBGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1609.03126) | \u003Cimg src = 'assets\u002Fequations\u002FEBGAN.png' height = '70px'>\n**BEGAN**| [Arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.10717) | \u003Cimg src = 'assets\u002Fequations\u002FBEGAN.png' height = '105px'>  \n\n#### GAN结构变体（图片引用自[tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)）\n\u003Cimg src = 'assets\u002Fetc\u002FGAN_structure.png' height = '600px'>\n\n### MNIST 数据集结果\n生成器和判别器的网络架构与 [infoGAN 论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1606.03657) 中完全一致。  \n为了公平比较各类 GAN 的核心思想，除 EBGAN 和 BEGAN 外，所有实现的网络架构均保持一致。由于 EBGAN 和 BEGAN 采用了自编码器结构作为判别器，因此对其进行了小幅修改，但我尽量保持了判别器的容量。\n\n以下结果可通过以下命令复现：  \n```\npython main.py --dataset mnist --gan_type \u003CTYPE> --epoch 50 --batch_size 64\n```\n\n#### 固定噪声生成\n所有结果均由固定的噪声向量生成。\n\n*名称* | *第1轮* | *第25轮* | *第50轮* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_generate_animation.gif' height = '200px'>\nLSGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_generate_animation.gif' height = '200px'>\nWGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_generate_animation.gif' height = '200px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_generate_animation.gif' height = '200px'>\nDRAGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_generate_animation.gif' height = '200px'>\nEBGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_generate_animation.gif' height = '200px'>\nBEGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_generate_animation.gif' height = '200px'>\n\n#### 条件生成\n每一行使用相同的噪声向量，每一列使用相同的标签条件。\n\n*名称* | *第1轮* | *第25轮* | *第50轮* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nCGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_generate_animation.gif' height = '200px'>\nACGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_generate_animation.gif' height = '200px'>\ninfoGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_generate_animation.gif' height = '200px'>\n\n#### InfoGAN：操纵两个连续编码\n所有结果使用相同的噪声向量和标签条件，但连续向量不同。\n\n*名称* | *第1轮* | *第25轮* | *第50轮* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\ninfoGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_cont_generate_animation.gif' height = '200px'>\n\n#### 损失曲线图\n\n*名称* | *损失*\n:---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FGAN_loss.png' height = '230px'>\nLSGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FLSGAN_loss.png' height = '230px'>\nWGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_loss.png' height = '230px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Fmnist_results\u002FWGAN_GP_loss.png' height = '230px'>\nDRAGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FDRAGAN_loss.png' height = '230px'>\nEBGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FEBGAN_loss.png' height = '230px'>\nBEGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FBEGAN_loss.png' height = '230px'>\nCGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FCGAN_loss.png' height = '230px'>\nACGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FACGAN_loss.png' height = '230px'>\ninfoGAN | \u003Cimg src = 'assets\u002Fmnist_results\u002FinfoGAN_loss.png' height = '230px'>\n\n### Fashion-MNIST 的结果\n关于 MNIST 网络架构的评论同样适用于此处。  \n[Fashion-MNIST](https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Ffashion-mnist) 是一个近期提出的数据集，包含 60,000 个训练样本和 10,000 个测试样本。每个样本是 28×28 像素的灰度图像，并对应 10 个类别之一。（T恤\u002F上衣、裤子、套头衫、连衣裙、外套、凉鞋、衬衫、运动鞋、包、短靴）\n\n以下结果可通过以下命令复现：  \n```\npython main.py --dataset fashion-mnist --gan_type \u003CTYPE> --epoch 50 --batch_size 64\n```\n\n#### 固定生成\n所有结果均基于固定的噪声向量生成。\n\n*名称* | *第1轮* | *第25轮* | *第50轮* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_generate_animation.gif' height = '200px'>\nLSGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_generate_animation.gif' height = '200px'>\nWGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_generate_animation.gif' height = '200px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_generate_animation.gif' height = '200px'>\nDRAGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_generate_animation.gif' height = '200px'>\nEBGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_generate_animation.gif' height = '200px'>\nBEGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_generate_animation.gif' height = '200px'>\n\n#### 条件生成\n每一行使用相同的噪声向量，每一列使用相同的标签条件。\n\n*名称* | *第1轮* | *第25轮* | *第50轮* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\nCGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_generate_animation.gif' height = '200px'>\nACGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_generate_animation.gif' height = '200px'>\ninfoGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_generate_animation.gif' height = '200px'>\n\n- ACGAN 在 [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections) 中容易出现模式坍塌现象，但 PyTorch 实现的 ACGAN 并未出现模式坍塌。\n\n#### InfoGAN：操纵两个连续编码\n所有结果使用相同的噪声向量和标签条件，但连续向量不同。\n\n*名称* | *第1轮* | *第25轮* | *第50轮* | *GIF*\n:---: | :---: | :---: | :---: | :---: |\ninfoGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_epoch001.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_epoch025.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_epoch050.png' height = '200px'> | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_cont_generate_animation.gif' height = '200px'>\n\n#### 损失曲线图\n\n*名称* | *损失*\n:---: | :---: |\nGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FGAN_loss.png' height = '230px'>\nLSGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FLSGAN_loss.png' height = '230px'>\nWGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_loss.png' height = '230px'>\nWGAN_GP | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FWGAN_GP_loss.png' height = '230px'>\nDRAGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FDRAGAN_loss.png' height = '230px'>\nEBGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FEBGAN_loss.png' height = '230px'>\nBEGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FBEGAN_loss.png' height = '230px'>\nCGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FCGAN_loss.png' height = '230px'>\nACGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FACGAN_loss.png' height = '230px'>\ninfoGAN | \u003Cimg src = 'assets\u002Ffashion_mnist_results\u002FinfoGAN_loss.png' height = '230px'>\n\n## 文件夹结构\n以下是基本的文件夹结构。\n```\n├── main.py # 入口文件\n├── data\n│   ├── mnist # MNIST 数据（本仓库不包含）\n│   ├── ...\n│   ├── ...\n│   └── fashion-mnist # Fashion-MNIST 数据（本仓库不包含）\n│\n├── GAN.py # 原始 GAN 实现\n├── utils.py # 工具函数\n├── dataloader.py # 数据加载器\n├── models # 模型文件存放目录\n└── results # 生成结果存放目录\n```\n\n## 开发环境\n* Ubuntu 16.04 LTS\n* NVIDIA GTX 1080 Ti\n* CUDA 9.0\n* Python 3.5.2\n* PyTorch 0.4.0\n* torchvision 0.2.1\n* NumPy 1.14.3\n* Matplotlib 2.2.2\n* imageio 2.3.0\n* SciPy 1.1.0\n\n## 致谢\n本实现基于 [tensorflow-generative-model-collections](https:\u002F\u002Fgithub.com\u002Fhwalsuklee\u002Ftensorflow-generative-model-collections)，并在 Ubuntu 16.04 上使用 GPU 和 PyTorch 0.4.0 进行了测试。","# pytorch-generative-model-collections 快速上手指南\n\n本工具是基于 PyTorch 实现的多种生成对抗网络（GAN）集合，参考了 Hwalsuk Lee 的 TensorFlow 版本。它提供了包括 GAN、LSGAN、WGAN、CGAN、InfoGAN 等在内的多种主流变体，适用于图像生成研究与学习。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**：Linux \u002F macOS \u002F Windows\n- **Python 版本**：推荐 Python 3.6+\n- **硬件要求**：\n  - **GPU**：强烈推荐使用 NVIDIA GPU 进行训练（代码仅在 GPU 模式下经过测试）。\n  - **CPU**：代码包含 CPU 模式支持，但作者未进行测试，稳定性不保证。\n\n### 前置依赖\n请确保已安装以下核心库：\n- `pytorch` (建议最新版本)\n- `torchvision`\n- `numpy`\n- `scipy`\n- `matplotlib`\n\n> **国内加速建议**：\n> - 安装 PyTorch 时，推荐使用清华或中科大镜像源。\n> - 数据集下载若遇阻，可手动下载后放置于项目数据目录。\n\n## 安装步骤\n\n1. **克隆仓库**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fwiseodd\u002Fpytorch-generative-model-collections.git\n   cd pytorch-generative-model-collections\n   ```\n\n2. **安装依赖**\n   如果尚未安装 PyTorch，请先访问 [PyTorch 官网](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F) 获取适合你环境的安装命令。以下是使用 pip 安装其他依赖的示例：\n   \n   *使用国内镜像源加速安装：*\n   ```bash\n   pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n   ```\n   *(注：若项目中无 requirements.txt 文件，请手动安装上述“前置依赖”中列出的库)*\n\n## 基本使用\n\n本项目通过 `main.py` 脚本统一入口，支持切换不同的数据集和 GAN 模型类型。\n\n### 1. 训练模型\n\n**语法格式：**\n```bash\npython main.py --dataset \u003C数据集名称> --gan_type \u003C模型类型> --epoch \u003C训练轮数> --batch_size \u003C批次大小>\n```\n\n**常用参数说明：**\n- `--dataset`: 支持 `mnist`, `fashion-mnist`, `cifar10`, `svhn`, `stl10`, `lsun-bed`。\n  > *注意：作者仅在 `mnist` 和 `fashion-mnist` 上完成了完整测试。*\n- `--gan_type`: 支持的模型包括 `GAN`, `LSGAN`, `WGAN`, `WGAN_GP`, `DRAGAN`, `CGAN`, `infoGAN`, `ACGAN`, `EBGAN`, `BEGAN`。\n\n**最简单的使用示例（在 MNIST 数据集上训练基础 GAN）：**\n```bash\npython main.py --dataset mnist --gan_type GAN --epoch 50 --batch_size 64\n```\n\n**在 Fashion-MNIST 数据集上训练 WGAN-GP：**\n```bash\npython main.py --dataset fashion-mnist --gan_type WGAN_GP --epoch 50 --batch_size 64\n```\n\n### 2. 查看结果\n训练过程中，模型会自动保存生成的图像样本（固定噪声生成、条件生成等）以及损失函数曲线图。输出结果通常保存在项目根目录下的 `results` 或对应数据集的子文件夹中（具体路径视代码实际运行配置而定），包含不同 Epoch 的生成效果对比图及 GIF 动画。\n\n### 3. 网络架构说明\n为了保证公平对比核心思想，除 EBGAN 和 BEGAN（因其判别器采用自编码器结构需微调）外，其余所有模型的生成器和判别器网络架构均保持与 InfoGAN 论文一致。","某初创公司的算法工程师正在为电商平台的“虚拟试衣间”功能研发图像生成模块，需要快速验证多种生成对抗网络（GAN）架构在服装数据集上的表现。\n\n### 没有 pytorch-generative-model-collections 时\n- **重复造轮子耗时严重**：团队需从零手写 GAN、WGAN、LSGAN 等十多种模型的底层代码，仅复现论文公式就耗费了数周时间。\n- **调参对比困难**：不同模型的网络结构、损失函数实现风格各异，导致无法在统一架构下公平对比各算法在服装生成任务上的核心优劣。\n- **环境适配风险高**：自行实现的代码缺乏多数据集（如 Fashion-MNIST、CIFAR10）的预验证，常在 GPU 训练时遭遇维度不匹配或梯度爆炸等隐蔽 Bug。\n- **实验迭代缓慢**：每尝试一种新变体（如从标准 GAN 切换到 infoGAN），都需要大幅重构代码，严重拖慢了原型验证进度。\n\n### 使用 pytorch-generative-model-collections 后\n- **开箱即用加速研发**：直接调用库中已封装好的 10+ 种主流 GAN 模型（包括 WGAN_GP、ACGAN 等），将原本数周的复现工作缩短至几小时。\n- **标准化公平评测**：所有模型共享统一的生成器与判别器架构基础（除特殊结构外），工程师可专注于调整超参数，精准评估哪种算法最适合生成清晰衣物纹理。\n- **稳定可靠的基线**：基于已在 MNIST 和 Fashion-MNIST 上测试通过的代码，直接迁移至服装数据集，大幅减少了因代码错误导致的训练失败。\n- **灵活高效的探索**：通过简单的命令行参数（如 `--gan_type`）即可在不同模型间无缝切换，一天内即可完成多种架构的消融实验并产出可视化结果。\n\npytorch-generative-model-collections 通过提供标准化、多样化的 GAN 实现集合，让开发者从繁琐的底层复现中解放出来，专注于业务场景的算法选型与优化。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fznxlwm_pytorch-generative-model-collections_1b52e8d4.png","znxlwm","Hyeonwoo Kang","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fznxlwm_9426cc54.png",null,"NCSOFT AI Research","znxlwm@gmail.com","https:\u002F\u002Fgithub.com\u002Fznxlwm",[81],{"name":82,"color":83,"percentage":84},"Python","#3572A5",100,2635,539,"2026-04-10T07:33:32","未说明","非必需（代码包含 CPU 模式但未测试），作者仅在 GPU 模式下测试过；具体显卡型号、显存大小及 CUDA 版本未说明",{"notes":91,"python":88,"dependencies":92},"该工具是多种 GAN 模型的 PyTorch 实现。虽然代码包含 CPU 运行模式，但作者明确表示仅在 GPU 模式下进行了测试，CPU 模式可能不稳定。支持的数据集包括 MNIST、Fashion-MNIST、CIFAR10 等，但作者仅在 MNIST 和 Fashion-MNIST 上验证了代码效果。",[93],"pytorch",[15,14],[93,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111],"gan","cgan","infogan","acgan","wgan","dragan","ebgan","began","generative-adversarial-network","conditional-gan","mnist","fashion-mnist","package","collection","wgan-gp","lsgan","2026-03-27T02:49:30.150509","2026-04-14T12:35:51.453529",[115,120,125,130],{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},32654,"ACGAN 的实现中，判别器（Discriminator）是否应该使用类别信息 'c'？代码中的 'y_fill_' 变量是否多余？","根据维护者的回复，原论文示意图可能有误，但当前的代码实现（判别器过程中不使用类别信息）是正确的。因此，变量 'y_fill_' 在此情况下确实是多余的。关于 C_fake_loss，虽然理论上可以使用随机标签，但由于数据加载器中已经提供了真实的标签信息，因此没有必要使用随机标签。","https:\u002F\u002Fgithub.com\u002Fznxlwm\u002Fpytorch-generative-model-collections\u002Fissues\u002F13",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},32655,"运行代码时遇到 RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28] 错误，如何解决？","该错误通常由图像通道数与归一化参数不匹配引起。如果是单通道灰度图（如 MNIST），需要修改数据预处理部分的代码。将原本针对 3 通道的设置：\n`transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))`\n改为针对单通道的设置：\n`transforms.Normalize((0.5,), (0.5,))`\n同时确保 Resize 操作正确，例如：\n`transform = transforms.Compose([transforms.Resize(32), transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,))])`","https:\u002F\u002Fgithub.com\u002Fznxlwm\u002Fpytorch-generative-model-collections\u002Fissues\u002F32",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},32656,"为什么在 ACGAN 的训练循环中需要反复调用 net.train()，而官方 PyTorch GAN 示例中没有这样做？","这是因为在 `visualize_results` 函数中调用了 `G.eval()` 以用于生成可视化图像。为了确保训练继续进行，必须在每次调用可视化函数后，显式地通过 `D.train()` 和 `G.train()` 将模型模式重新设回训练模式。这是正确的做法，官方示例可能遗漏了这一点。","https:\u002F\u002Fgithub.com\u002Fznxlwm\u002Fpytorch-generative-model-collections\u002Fissues\u002F9",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},32657,"尝试加载 CelebA 数据集时报错 'AttributeError: module 'utils' has no attribute 'load_celebA''，怎么办？","这是由于仓库中的 `utils.py` 文件未及时更新，缺少了加载 CelebA 数据集的函数。维护者已确认这是失误并更新了 `utils.py` 文件。解决方法是拉取最新的代码更新，或者手动检查并补充 `utils.py` 中缺失的 `load_celebA` 函数定义。","https:\u002F\u002Fgithub.com\u002Fznxlwm\u002Fpytorch-generative-model-collections\u002Fissues\u002F1",[]]