[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-taki0112--Tensorflow-Cookbook":3,"tool-taki0112--Tensorflow-Cookbook":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":82,"owner_website":83,"owner_url":84,"languages":85,"stars":90,"forks":91,"last_commit_at":92,"license":93,"difficulty_score":23,"env_os":94,"env_gpu":94,"env_ram":94,"env_deps":95,"category_tags":99,"github_topics":100,"view_count":10,"oss_zip_url":82,"oss_zip_packed_at":82,"status":16,"created_at":103,"updated_at":104,"faqs":105,"releases":116},687,"taki0112\u002FTensorflow-Cookbook","Tensorflow-Cookbook","Simple Tensorflow Cookbook for easy-to-use","Tensorflow-Cookbook 是一个面向 TensorFlow 的开源代码库，旨在提供简单易用的构建模块，帮助开发者快速搭建深度学习模型。Tensorflow-Cookbook 汇集了常用的网络架构、函数和图像处理工具，有效解决了从零开始配置环境和高频调用底层 API 的繁琐问题。\n\nTensorflow-Cookbook 适合需要快速原型开发的深度学习工程师、计算机视觉研究人员以及希望简化 TensorFlow 学习曲线的学生。通过 ops.py 和 utils.py 等模块，用户可以直接调用卷积、图像预处理等操作，无需反复查阅文档。\n\nTensorflow-Cookbook 的独特亮点在于支持生成对抗网络（GAN）和分类任务的通用架构，内置了多种卷积变体（如部分卷积、空洞卷积），并集成了数据加载的 DatasetAPI 模板。此外，还提供了丰富的权重初始化和正则化选项，如谱归一化等高级功能。借助 Tensorflow-Cookbook，开发者可以大幅减少样板代码，将精力集中在核心算法的创新上。","\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_23043851f5ec.png\" height = '300px'>\n\u003C\u002Fdiv>\n\n\n# [Web page](http:\u002F\u002Fbit.ly\u002Fjhkim_tf_cookbook)\n# [Tensorflow 2 Cookbook](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow2-Cookbook)\n\n## Contributions\nIn now, this repo contains general architectures and functions that are useful for the GAN and classificstion.\n\nI will continue to add useful things to other areas.\n\nAlso, your pull requests and issues are always welcome.\n\nAnd write what you want to implement on the issue. I'll implement it.\n\n# How to use\n## Import\n* `ops.py`\n  * **operations**\n  * from ops import *\n* `utils.py`\n  * **image processing**\n  * from utils import *\n  \n## Network template\n```python\ndef network(x, is_training=True, reuse=False, scope=\"network\"):\n    with tf.variable_scope(scope, reuse=reuse):\n        x = conv(...)\n        \n        ...\n        \n        return logit\n```\n\n## Insert data to network using DatasetAPI\n```python\nImage_Data_Class = ImageData(img_size, img_ch, augment_flag)\n\ntrainA_dataset = ['.\u002Fdataset\u002Fcat\u002FtrainA\u002Fa.jpg', \n                  '.\u002Fdataset\u002Fcat\u002FtrainA\u002Fb.png', \n                  '.\u002Fdataset\u002Fcat\u002FtrainA\u002Fc.jpeg', \n                  ...]\ntrainA = tf.data.Dataset.from_tensor_slices(trainA_dataset)\ntrainA = trainA.map(Image_Data_Class.image_processing, num_parallel_calls=16)\ntrainA = trainA.shuffle(buffer_size=10000).prefetch(buffer_size=batch_size).batch(batch_size).repeat()\n\ntrainA_iterator = trainA.make_one_shot_iterator()\ndata_A = trainA_iterator.get_next()\n\nlogit = network(data_A)\n```\n* See [this](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow-DatasetAPI) for more information.\n\n## Option\n* `padding='SAME'`\n  * pad = ceil[ (kernel - stride) \u002F 2 ]\n* `pad_type`\n  * 'zero' or 'reflect'\n* `sn`\n  * use [spectral_normalization](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1802.05957.pdf) or not\n\n## Caution\n* If you don't want to share variable, **set all scope names differently.**\n\n---\n## Weight\n```python\nweight_init = tf.truncated_normal_initializer(mean=0.0, stddev=0.02)\nweight_regularizer = tf.contrib.layers.l2_regularizer(0.0001)\nweight_regularizer_fully = tf.contrib.layers.l2_regularizer(0.0001)\n```\n### Initialization\n* `Xavier` : tf.contrib.layers.xavier_initializer()\n  ```python\n  \n    USE \"\"\"tf.contrib.layers.variance_scaling_initializer()\"\"\"\n    \n    if uniform :\n      factor = gain * gain\n      mode = 'FAN_AVG'\n    else :\n      factor = (gain * gain) \u002F 1.3\n      mode = 'FAN_AVG'\n  ```\n* `He` : tf.contrib.layers.variance_scaling_initializer()\n  ```python\n    if uniform :\n      factor = gain * gain\n      mode = 'FAN_IN'\n    else :\n      factor = (gain * gain) \u002F 1.3\n      mode = 'FAN_OUT'\n  ```\n* `Normal` : tf.random_normal_initializer(mean=0.0, stddev=0.02)\n* `Truncated_normal` : tf.truncated_normal_initializer(mean=0.0, stddev=0.02)\n* `Orthogonal` : tf.orthogonal_initializer(1.0) \u002F # if relu = sqrt(2), the others = 1.0\n\n### Regularization\n* `l2_decay` : tf.contrib.layers.l2_regularizer(0.0001)\n* `orthogonal_regularizer` : orthogonal_regularizer(0.0001) & orthogonal_regularizer_fully(0.0001)\n\n## Convolution\n### basic conv\n```python\nx = conv(x, channels=64, kernel=3, stride=2, pad=1, pad_type='reflect', use_bias=True, sn=True, scope='conv')\n```\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_d552433faa83.gif\" width = '300px'>\n\u003C\u002Fdiv>\n\n### partial conv (NVIDIA [Partial Convolution](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fpartialconv))\n```python\nx = partial_conv(x, channels=64, kernel=3, stride=2, use_bias=True, padding='SAME', sn=True, scope='partial_conv')\n```\n\n![p_conv](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_35a188670a87.png)\n![p_result](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_69336c2b8b3a.png)\n\n### dilated conv\n```python\nx = dilate_conv(x, channels=64, kernel=3, rate=2, use_bias=True, padding='VALID', sn=True, scope='dilate_conv')\n```\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_4959201e8168.gif\" width = '300px'>\n\u003C\u002Fdiv>\n\n---\n\n## Deconvolution\n### basic deconv\n```python\nx = deconv(x, channels=64, kernel=3, stride=1, padding='SAME', use_bias=True, sn=True, scope='deconv')\n```\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_4992be8ec587.gif\" width = '300px'>\n\u003C\u002Fdiv>\n\n---\n\n## Fully-connected\n```python\nx = fully_connected(x, units=64, use_bias=True, sn=True, scope='fully_connected')\n```\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fstanford.edu\u002F~shervine\u002Fteaching\u002Fcs-230\u002Fillustrations\u002Ffully-connected.png\">\n\u003C\u002Fdiv>\n\n---\n\n## Pixel shuffle\n```python\nx = conv_pixel_shuffle_down(x, scale_factor=2, use_bias=True, sn=True, scope='pixel_shuffle_down')\nx = conv_pixel_shuffle_up(x, scale_factor=2, use_bias=True, sn=True, scope='pixel_shuffle_up')\n```\n* `down` ===> [height, width] -> [**height \u002F\u002F scale_factor, width \u002F\u002F scale_factor**]\n* `up` ===> [height, width] -> [**height \\* scale_factor, width \\* scale_factor**]\n\n![pixel_shuffle](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_60ea0a4e25f1.png)\n\n\n---\n\n## Block\n### residual block\n```python\nx = resblock(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block')\nx = resblock_down(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block_down')\nx = resblock_up(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block_up')\n```\n* `down` ===> [height, width] -> [**height \u002F\u002F 2, width \u002F\u002F 2**]\n* `up` ===> [height, width] -> [**height \\* 2, width \\* 2**]\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_d87dd0022482.png\">\n\u003C\u002Fdiv>\n\n### dense block\n```python\nx = denseblock(x, channels=64, n_db=6, is_training=is_training, use_bias=True, sn=True, scope='denseblock')\n```\n* `n_db` ===> The number of dense-block\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_215351a24331.jpg\" height = '400px'>\n\u003C\u002Fdiv>\n\n### residual-dense block\n```python\nx = res_denseblock(x, channels=64, n_rdb=20, n_rdb_conv=6, is_training=is_training, use_bias=True, sn=True, scope='res_denseblock')\n```\n* `n_rdb` ===> The number of RDB\n* `n_rdb_conv` ===> per RDB conv layer\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Fcompare.png height = '400px'>\n  \u003Cimg src=.\u002Fassets\u002Frdn.png height = '350px' width='800px'>\n  \u003Cimg src=.\u002Fassets\u002Frdb.png height = '250px' width='650px'>\n\u003C\u002Fdiv>\n\n### attention block\n```python\nx = self_attention(x, use_bias=True, sn=True, scope='self_attention')\nx = self_attention_with_pooling(x, use_bias=True, sn=True, scope='self_attention_version_2')\n\nx = squeeze_excitation(x, ratio=16, use_bias=True, sn=True, scope='squeeze_excitation')\n\nx = convolution_block_attention(x, ratio=16, use_bias=True, sn=True, scope='convolution_block_attention')\n\nx = global_context_block(x, use_bias=True, sn=True, scope='gc_block')\n\nx = srm_block(x, use_bias=False, is_training=is_training, scope='srm_block')\n```\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_902eed3c765e.png\">\n\u003C\u002Fdiv>\n\n---\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_6051725c72b7.jpg\" width=\"420\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_108f6d7da18c.jpg\"  width=\"420\">\n\u003C\u002Fdiv>\n\n---\n\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_ab34300e8219.png\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_5692e1802978.png\">\n\u003C\u002Fdiv>\n\n\n---\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Fgcb.png>\n\u003C\u002Fdiv>\n\n---\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Fsrm.png height='350' width='500'>\n\u003C\u002Fdiv>\n\n---\n\n## Normalization\n```python\nx = batch_norm(x, is_training=is_training, scope='batch_norm')\nx = layer_norm(x, scope='layer_norm')\nx = instance_norm(x, scope='instance_norm')\nx = group_norm(x, groups=32, scope='group_norm')\n\nx = pixel_norm(x)\n\nx = batch_instance_norm(x, scope='batch_instance_norm')\nx = layer_instance_norm(x, scope='layer_instance_norm')\nx = switch_norm(x, scope='switch_norm')\n\nx = condition_batch_norm(x, z, is_training=is_training, scope='condition_batch_norm'):\n\nx = adaptive_instance_norm(x, gamma, beta)\nx = adaptive_layer_instance_norm(x, gamma, beta, smoothing=True, scope='adaLIN')\n\n```\n* See [this](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FBigGAN-Tensorflow) for how to use `condition_batch_norm`\n* See [this](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FMUNIT-Tensorflow) for how to use `adaptive_instance_norm`\n* See [this](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FUGATIT) for how to use `adaptive_layer_instance_norm` & `layer_instance_norm`\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_cb45943ff4cb.png\">\n\u003C\u002Fdiv>\n\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_ae68e1373942.png\">\n\u003C\u002Fdiv>\n\n---\n\n## Activation\n```python\nx = relu(x)\nx = lrelu(x, alpha=0.2)\nx = tanh(x)\nx = sigmoid(x)\nx = swish(x)\nx = elu(x)\n```\n\n---\n\n## Pooling & Resize\n```python\nx = nearest_up_sample(x, scale_factor=2)\nx = bilinear_up_sample(x, scale_factor=2)\nx = nearest_down_sample(x, scale_factor=2)\nx = bilinear_down_sample(x, scale_factor=2)\n\nx = max_pooling(x, pool_size=2)\nx = avg_pooling(x, pool_size=2)\n\nx = global_max_pooling(x)\nx = global_avg_pooling(x)\n\nx = flatten(x)\nx = hw_flatten(x)\n```\n\n---\n\n## Loss\n### classification loss\n```python\nloss, accuracy = classification_loss(logit, label)\n\nloss = dice_loss(n_classes=10, logit, label)\n```\n\n### regularization loss\n```python\ng_reg_loss = regularization_loss('generator')\nd_reg_loss = regularization_loss('discriminator')\n```\n\n* If you want to use `regularizer`, then you should write it\n\n### pixel loss\n```python\nloss = L1_loss(x, y)\nloss = L2_loss(x, y)\nloss = huber_loss(x, y)\nloss = histogram_loss(x, y)\n\nloss = gram_style_loss(x, y)\n\nloss = color_consistency_loss(x, y)\n```\n* `histogram_loss` means the difference in the color distribution of the image pixel values.\n* `gram_style_loss` means the difference between the styles using gram matrix.\n* `color_consistency_loss` means the color difference between the generated image and the input image.\n\n### gan loss\n```python\nd_loss = discriminator_loss(Ra=True, loss_func='wgan-gp', real=real_logit, fake=fake_logit)\ng_loss = generator_loss(Ra=True, loss_func='wgan-gp', real=real_logit, fake=fake_logit)\n```\n* `Ra`\n  * use [relativistic gan](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1807.00734.pdf) or not\n* `loss_func`\n  * gan\n  * lsgan\n  * hinge\n  * wgan-gp\n  * dragan\n* See [this](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FBigGAN-Tensorflow\u002Fblob\u002Fmaster\u002FBigGAN_512.py#L180) for how to use `gradient_penalty`\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Frelativistic.png>\n\u003C\u002Fdiv>\n\n### [vdb loss](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.00821)\n```python\nd_bottleneck_loss = vdb_loss(real_mu, real_logvar, i_c) + vdb_loss(fake_mu, fake_logvar, i_c)\n```\n\n### kl-divergence (z ~ N(0, 1))\n```python\nloss = kl_loss(mean, logvar)\n```\n\n---\n\n## Author\n[Junho Kim](http:\u002F\u002Fbit.ly\u002Fjhkim_ai)\n","\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_23043851f5ec.png\" height = '300px'>\n\u003C\u002Fdiv>\n\n\n# [网页](http:\u002F\u002Fbit.ly\u002Fjhkim_tf_cookbook)\n# [TensorFlow 2 实战指南](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow2-Cookbook)\n\n## 贡献\n目前，该仓库包含对生成对抗网络（GAN）和分类任务有用的通用架构和函数。\n\n我将继续添加其他领域的有用内容。\n\n同时，我们欢迎您的拉取请求（Pull Requests）和问题反馈（Issues）。\n\n如果您想实现某些功能，请在 Issue 中写下您的需求，我会去实现它。\n\n# 如何使用\n## 导入\n* `ops.py`\n  * **操作**\n  * from ops import *\n* `utils.py`\n  * **图像处理**\n  * from utils import *\n  \n## 网络模板\n```python\ndef network(x, is_training=True, reuse=False, scope=\"network\"):\n    with tf.variable_scope(scope, reuse=reuse):\n        x = conv(...)\n        \n        ...\n        \n        return logit\n```\n\n## 使用 DatasetAPI（数据集 API）将数据插入网络\n```python\nImage_Data_Class = ImageData(img_size, img_ch, augment_flag)\n\ntrainA_dataset = ['.\u002Fdataset\u002Fcat\u002FtrainA\u002Fa.jpg', \n                  '.\u002Fdataset\u002Fcat\u002FtrainA\u002Fb.png', \n                  '.\u002Fdataset\u002Fcat\u002FtrainA\u002Fc.jpeg', \n                  ...]\ntrainA = tf.data.Dataset.from_tensor_slices(trainA_dataset)\ntrainA = trainA.map(Image_Data_Class.image_processing, num_parallel_calls=16)\ntrainA = trainA.shuffle(buffer_size=10000).prefetch(buffer_size=batch_size).batch(batch_size).repeat()\n\ntrainA_iterator = trainA.make_one_shot_iterator()\ndata_A = trainA_iterator.get_next()\n\nlogit = network(data_A)\n```\n* 更多信息请参见 [此链接](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow-DatasetAPI)。\n\n## 选项\n* `padding='SAME'`\n  * pad = ceil[ (kernel - stride) \u002F 2 ]\n* `pad_type`\n  * 'zero' or 'reflect'\n* `sn`\n  * 是否使用 [谱归一化（spectral_normalization）](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1802.05957.pdf)\n\n## 注意\n* 如果您不希望共享变量，请**将所有作用域名称设置为不同。**\n\n---\n## 权重\n```python\nweight_init = tf.truncated_normal_initializer(mean=0.0, stddev=0.02)\nweight_regularizer = tf.contrib.layers.l2_regularizer(0.0001)\nweight_regularizer_fully = tf.contrib.layers.l2_regularizer(0.0001)\n```\n### 初始化\n* `Xavier` : tf.contrib.layers.xavier_initializer()\n  ```python\n  \n    USE \"\"\"tf.contrib.layers.variance_scaling_initializer()\"\"\"\n    \n    if uniform :\n      factor = gain * gain\n      mode = 'FAN_AVG'\n    else :\n      factor = (gain * gain) \u002F 1.3\n      mode = 'FAN_AVG'\n  ```\n* `He` : tf.contrib.layers.variance_scaling_initializer()\n  ```python\n    if uniform :\n      factor = gain * gain\n      mode = 'FAN_IN'\n    else :\n      factor = (gain * gain) \u002F 1.3\n      mode = 'FAN_OUT'\n  ```\n* `Normal` : tf.random_normal_initializer(mean=0.0, stddev=0.02)\n* `Truncated_normal` : tf.truncated_normal_initializer(mean=0.0, stddev=0.02)\n* `Orthogonal` : tf.orthogonal_initializer(1.0) \u002F # if relu = sqrt(2), the others = 1.0\n\n### 正则化\n* `l2_decay` : tf.contrib.layers.l2_regularizer(0.0001)\n* `orthogonal_regularizer` : orthogonal_regularizer(0.0001) & orthogonal_regularizer_fully(0.0001)\n\n## 卷积（Convolution）\n### 基础卷积\n```python\nx = conv(x, channels=64, kernel=3, stride=2, pad=1, pad_type='reflect', use_bias=True, sn=True, scope='conv')\n```\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_d552433faa83.gif\" width = '300px'>\n\u003C\u002Fdiv>\n\n### 部分卷积（NVIDIA [部分卷积](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fpartialconv)）\n```python\nx = partial_conv(x, channels=64, kernel=3, stride=2, use_bias=True, padding='SAME', sn=True, scope='partial_conv')\n```\n\n![p_conv](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_35a188670a87.png)\n![p_result](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_69336c2b8b3a.png)\n\n### 空洞卷积（Dilated Convolution）\n```python\nx = dilate_conv(x, channels=64, kernel=3, rate=2, use_bias=True, padding='VALID', sn=True, scope='dilate_conv')\n```\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_4959201e8168.gif\" width = '300px'>\n\u003C\u002Fdiv>\n\n---\n\n## 反卷积（Deconvolution）\n### 基础反卷积\n```python\nx = deconv(x, channels=64, kernel=3, stride=1, padding='SAME', use_bias=True, sn=True, scope='deconv')\n```\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_4992be8ec587.gif\" width = '300px'>\n\u003C\u002Fdiv>\n\n---\n\n## 全连接（Fully-connected）\n```python\nx = fully_connected(x, units=64, use_bias=True, sn=True, scope='fully_connected')\n```\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fstanford.edu\u002F~shervine\u002Fteaching\u002Fcs-230\u002Fillustrations\u002Ffully-connected.png\">\n\u003C\u002Fdiv>\n\n---\n\n## 像素洗牌（Pixel shuffle）\n```python\nx = conv_pixel_shuffle_down(x, scale_factor=2, use_bias=True, sn=True, scope='pixel_shuffle_down')\nx = conv_pixel_shuffle_up(x, scale_factor=2, use_bias=True, sn=True, scope='pixel_shuffle_up')\n```\n* `down` ===> [height, width] -> [**height \u002F\u002F scale_factor, width \u002F\u002F scale_factor**]\n* `up` ===> [height, width] -> [**height \\* scale_factor, width \\* scale_factor**]\n\n![pixel_shuffle](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_60ea0a4e25f1.png)\n\n\n---\n\n## 模块（Block）\n### 残差块（Residual block）\n```python\nx = resblock(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block')\nx = resblock_down(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block_down')\nx = resblock_up(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block_up')\n```\n* `down` ===> [height, width] -> [**height \u002F\u002F 2, width \u002F\u002F 2**]\n* `up` ===> [height, width] -> [**height \\* 2, width \\* 2**]\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_d87dd0022482.png\">\n\u003C\u002Fdiv>\n\n### 密集块（Dense block）\n```python\nx = denseblock(x, channels=64, n_db=6, is_training=is_training, use_bias=True, sn=True, scope='denseblock')\n```\n* `n_db` ===> 密集块的数量\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_215351a24331.jpg\" height = '400px'>\n\u003C\u002Fdiv>\n\n### 残差密集块（Residual-dense block）\n```python\nx = res_denseblock(x, channels=64, n_rdb=20, n_rdb_conv=6, is_training=is_training, use_bias=True, sn=True, scope='res_denseblock')\n```\n* `n_rdb` ===> RDB 的数量\n* `n_rdb_conv` ===> 每个 RDB 的卷积层数\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Fcompare.png height = '400px'>\n  \u003Cimg src=.\u002Fassets\u002Frdn.png height = '350px' width='800px'>\n  \u003Cimg src=.\u002Fassets\u002Frdb.png height = '250px' width='650px'>\n\u003C\u002Fdiv>\n\n### 注意力模块\n```python\nx = self_attention(x, use_bias=True, sn=True, scope='self_attention')\nx = self_attention_with_pooling(x, use_bias=True, sn=True, scope='self_attention_version_2')\n\nx = squeeze_excitation(x, ratio=16, use_bias=True, sn=True, scope='squeeze_excitation')\n\nx = convolution_block_attention(x, ratio=16, use_bias=True, sn=True, scope='convolution_block_attention')\n\nx = global_context_block(x, use_bias=True, sn=True, scope='gc_block')\n\nx = srm_block(x, use_bias=False, is_training=is_training, scope='srm_block')\n```\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_902eed3c765e.png\">\n\u003C\u002Fdiv>\n\n---\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_6051725c72b7.jpg\" width=\"420\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_108f6d7da18c.jpg\"  width=\"420\">\n\u003C\u002Fdiv>\n\n---\n\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_ab34300e8219.png\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_5692e1802978.png\">\n\u003C\u002Fdiv>\n\n\n---\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Fgcb.png>\n\u003C\u002Fdiv>\n\n---\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Fsrm.png height='350' width='500'>\n\u003C\u002Fdiv>\n\n---\n\n## 归一化\n```python\nx = batch_norm(x, is_training=is_training, scope='batch_norm')\nx = layer_norm(x, scope='layer_norm')\nx = instance_norm(x, scope='instance_norm')\nx = group_norm(x, groups=32, scope='group_norm')\n\nx = pixel_norm(x)\n\nx = batch_instance_norm(x, scope='batch_instance_norm')\nx = layer_instance_norm(x, scope='layer_instance_norm')\nx = switch_norm(x, scope='switch_norm')\n\nx = condition_batch_norm(x, z, is_training=is_training, scope='condition_batch_norm'):\n\nx = adaptive_instance_norm(x, gamma, beta)\nx = adaptive_layer_instance_norm(x, gamma, beta, smoothing=True, scope='adaLIN')\n\n```\n* 查看 [此链接](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FBigGAN-Tensorflow) 了解如何使用 `condition_batch_norm`\n* 查看 [此链接](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FMUNIT-Tensorflow) 了解如何使用 `adaptive_instance_norm`\n* 查看 [此链接](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FUGATIT) 了解如何使用 `adaptive_layer_instance_norm` & `layer_instance_norm`\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_cb45943ff4cb.png\">\n\u003C\u002Fdiv>\n\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_readme_ae68e1373942.png\">\n\u003C\u002Fdiv>\n\n---\n\n## 激活函数\n```python\nx = relu(x)\nx = lrelu(x, alpha=0.2)\nx = tanh(x)\nx = sigmoid(x)\nx = swish(x)\nx = elu(x)\n```\n\n---\n\n## 池化与调整大小\n```python\nx = nearest_up_sample(x, scale_factor=2)\nx = bilinear_up_sample(x, scale_factor=2)\nx = nearest_down_sample(x, scale_factor=2)\nx = bilinear_down_sample(x, scale_factor=2)\n\nx = max_pooling(x, pool_size=2)\nx = avg_pooling(x, pool_size=2)\n\nx = global_max_pooling(x)\nx = global_avg_pooling(x)\n\nx = flatten(x)\nx = hw_flatten(x)\n```\n\n---\n\n## 损失函数\n### 分类损失\n```python\nloss, accuracy = classification_loss(logit, label)\n\nloss = dice_loss(n_classes=10, logit, label)\n```\n\n### 正则化损失\n```python\ng_reg_loss = regularization_loss('generator')\nd_reg_loss = regularization_loss('discriminator')\n```\n\n* 如果您想使用正则化器，则需要自行实现\n\n### 像素损失\n```python\nloss = L1_loss(x, y)\nloss = L2_loss(x, y)\nloss = huber_loss(x, y)\nloss = histogram_loss(x, y)\n\nloss = gram_style_loss(x, y)\n\nloss = color_consistency_loss(x, y)\n```\n* `histogram_loss` 表示图像像素值颜色分布的差异。\n* `gram_style_loss` 表示使用格拉姆矩阵的风格差异。\n* `color_consistency_loss` 表示生成图像与输入图像之间的颜色差异。\n\n### GAN 损失\n```python\nd_loss = discriminator_loss(Ra=True, loss_func='wgan-gp', real=real_logit, fake=fake_logit)\ng_loss = generator_loss(Ra=True, loss_func='wgan-gp', real=real_logit, fake=fake_logit)\n```\n* `Ra`\n  * 是否使用 [相对性 GAN (relativistic gan)](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1807.00734.pdf)\n* `loss_func`\n  * gan\n  * lsgan\n  * hinge\n  * wgan-gp\n  * dragan\n* 查看 [此链接](https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FBigGAN-Tensorflow\u002Fblob\u002Fmaster\u002FBigGAN_512.py#L180) 了解如何使用 `gradient_penalty`\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=.\u002Fassets\u002Frelativistic.png>\n\u003C\u002Fdiv>\n\n### [VDB 损失 (vdb loss)](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.00821)\n```python\nd_bottleneck_loss = vdb_loss(real_mu, real_logvar, i_c) + vdb_loss(fake_mu, fake_logvar, i_c)\n```\n\n### KL 散度 (kl-divergence) (z ~ N(0, 1))\n```python\nloss = kl_loss(mean, logvar)\n```\n\n---\n\n## 作者\n[Junho Kim](http:\u002F\u002Fbit.ly\u002Fjhkim_ai)","# Tensorflow-Cookbook 快速上手指南\n\n## 1. 环境准备\n- **操作系统**: Linux \u002F Windows \u002F macOS\n- **编程语言**: Python 3.x\n- **核心依赖**: TensorFlow (注意：代码中包含 `tf.contrib` 相关调用，请确保 TensorFlow 版本兼容)\n- **硬件**: 建议使用 NVIDIA GPU 以加速模型训练\n\n## 2. 安装步骤\n克隆项目仓库并配置环境：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow2-Cookbook.git\ncd Tensorflow2-Cookbook\n# 确保已安装 TensorFlow\npip install tensorflow\n```\n\n## 3. 基本使用\n\n### 导入模块\n项目提供了通用的操作函数和图像处理工具，直接导入即可使用：\n\n```python\nfrom ops import *\nfrom utils import *\n```\n\n### 网络构建模板\n定义网络结构时，使用 `variable_scope` 管理变量作用域：\n\n```python\ndef network(x, is_training=True, reuse=False, scope=\"network\"):\n    with tf.variable_scope(scope, reuse=reuse):\n        x = conv(...)\n        \n        ...\n        \n        return logit\n```\n\n### 数据加载 (DatasetAPI)\n使用 TensorFlow 原生 Dataset API 加载图像数据并进行预处理：\n\n```python\nImage_Data_Class = ImageData(img_size, img_ch, augment_flag)\n\ntrainA_dataset = ['.\u002Fdataset\u002Fcat\u002FtrainA\u002Fa.jpg', \n                  '.\u002Fdataset\u002Fcat\u002FtrainA\u002Fb.png', \n                  ...]\ntrainA = tf.data.Dataset.from_tensor_slices(trainA_dataset)\ntrainA = trainA.map(Image_Data_Class.image_processing, num_parallel_calls=16)\ntrainA = trainA.shuffle(buffer_size=10000).prefetch(buffer_size=batch_size).batch(batch_size).repeat()\n\ntrainA_iterator = trainA.make_one_shot_iterator()\ndata_A = trainA_iterator.get_next()\n\nlogit = network(data_A)\n```\n\n### 常用算子示例\n项目中封装了丰富的神经网络层、归一化及损失函数，可直接调用：\n\n**卷积与反卷积**\n```python\nx = conv(x, channels=64, kernel=3, stride=2, pad=1, pad_type='reflect', use_bias=True, sn=True, scope='conv')\nx = deconv(x, channels=64, kernel=3, stride=1, padding='SAME', use_bias=True, sn=True, scope='deconv')\n```\n\n**网络模块 (Block)**\n```python\n# 残差块\nx = resblock(x, channels=64, is_training=is_training, use_bias=True, sn=True, scope='residual_block')\n# Dense Block\nx = denseblock(x, channels=64, n_db=6, is_training=is_training, use_bias=True, sn=True, scope='denseblock')\n```\n\n**归一化与激活**\n```python\nx = batch_norm(x, is_training=is_training, scope='batch_norm')\nx = lrelu(x, alpha=0.2)\n```\n\n**损失函数**\n```python\n# 分类损失\nloss, accuracy = classification_loss(logit, label)\n# GAN 损失\nd_loss = discriminator_loss(Ra=True, loss_func='wgan-gp', real=real_logit, fake=fake_logit)\n```","某医疗 AI 初创公司的算法工程师需要在两周内交付一个肺部 CT 影像分类原型系统。由于项目时间紧迫，团队对模型精度和开发效率都有极高要求。\n\n### 没有 Tensorflow-Cookbook 时\n- 需要从零手写卷积、池化等底层算子，代码冗余且容易在 padding 类型和 stride 参数上出现低级错误\n- 数据预处理与加载流程繁琐，手动编写 tf.data 管道难以兼顾图像增强与多进程读取的效率平衡\n- 网络权重初始化缺乏统一标准，常因初始值分布不当导致模型训练初期损失剧烈震荡，调试耗时\n\n### 使用 Tensorflow-Cookbook 后\n- 直接复用 ops.py 中的封装函数，一行代码即可配置包含谱归一化的高级卷积层，有效减少 Bug\n- 通过 DatasetAPI 模块快速构建数据管道，自动处理图像尺寸调整与并行映射，大幅缩短数据准备周期\n- 内置多种成熟的初始化策略（如 He、Xavier）及正则化选项，显著提升了模型收敛的稳定性与最终精度\n\n核心价值：将重复性工程细节抽象为标准化组件，让开发者能专注于模型架构创新而非底层实现。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftaki0112_Tensorflow-Cookbook_23043851.png","taki0112","Junho Kim","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftaki0112_c016fc7a.jpg","Research Scientist","NAVER AI Lab","South Korea","slaykim.ai@gmail.com",null,"taki0112.notion.site","https:\u002F\u002Fgithub.com\u002Ftaki0112",[86],{"name":87,"color":88,"percentage":89},"Python","#3572A5",100,2754,464,"2026-04-02T08:38:29","MIT","未说明",{"notes":96,"python":94,"dependencies":97},"该工具名为 Tensorflow2-Cookbook，但代码片段中使用了 tf.contrib 及 make_one_shot_iterator 等 TensorFlow 1.x 遗留 API（在 TF 2.x 中已移除），实际运行可能需使用特定版本的 TensorFlow 或开启兼容模式。主要面向 GAN 和图像分类任务，提供网络层、损失函数及归一化层的封装。",[98],"tensorflow",[13],[98,101,102],"tensorflow-cookbook","tensorflow-examples","2026-03-27T02:49:30.150509","2026-04-06T09:46:15.347451",[106,111],{"id":107,"question_zh":108,"answer_zh":109,"source_url":110},2869,"TensorFlow 2.0 版本的支持情况如何？","维护者已创建专门的 TensorFlow 2.0 Cookbook 仓库：https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow2-Cookbook。同时维护者表示正在将当前代码迁移至 2.0 版本，完成后会尽快更新。","https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow-Cookbook\u002Fissues\u002F3",{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},2870,"如何解决 ops.py 中出现的 TypeError: unsupported operand type(s) for %: 'int' and 'NoneType' 错误？","该错误通常是因为输入形状（input shape）的高度或宽度为 None 类型导致的。建议检查 `ops.py` 中卷积函数里的 `h` 变量，并确认是否必须使用动态形状（None type）。","https:\u002F\u002Fgithub.com\u002Ftaki0112\u002FTensorflow-Cookbook\u002Fissues\u002F2",[]]