[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-aymericdamien--TensorFlow-Examples":3,"tool-aymericdamien--TensorFlow-Examples":61},[4,18,28,37,45,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":24,"last_commit_at":25,"category_tags":26,"status":17},9989,"n8n","n8n-io\u002Fn8n","n8n 是一款面向技术团队的公平代码（fair-code）工作流自动化平台，旨在让用户在享受低代码快速构建便利的同时，保留编写自定义代码的灵活性。它主要解决了传统自动化工具要么过于封闭难以扩展、要么完全依赖手写代码效率低下的痛点，帮助用户轻松连接 400 多种应用与服务，实现复杂业务流程的自动化。\n\nn8n 特别适合开发者、工程师以及具备一定技术背景的业务人员使用。其核心亮点在于“按需编码”：既可以通过直观的可视化界面拖拽节点搭建流程，也能随时插入 JavaScript 或 Python 代码、调用 npm 包来处理复杂逻辑。此外，n8n 原生集成了基于 LangChain 的 AI 能力，支持用户利用自有数据和模型构建智能体工作流。在部署方面，n8n 提供极高的自由度，支持完全自托管以保障数据隐私和控制权，也提供云端服务选项。凭借活跃的社区生态和数百个现成模板，n8n 让构建强大且可控的自动化系统变得简单高效。",184740,2,"2026-04-19T23:22:26",[16,14,13,15,27],"插件",{"id":29,"name":30,"github_repo":31,"description_zh":32,"stars":33,"difficulty_score":10,"last_commit_at":34,"category_tags":35,"status":17},10095,"AutoGPT","Significant-Gravitas\u002FAutoGPT","AutoGPT 是一个旨在让每个人都能轻松使用和构建 AI 的强大平台，核心功能是帮助用户创建、部署和管理能够自动执行复杂任务的连续型 AI 智能体。它解决了传统 AI 应用中需要频繁人工干预、难以自动化长流程工作的痛点，让用户只需设定目标，AI 即可自主规划步骤、调用工具并持续运行直至完成任务。\n\n无论是开发者、研究人员，还是希望提升工作效率的普通用户，都能从 AutoGPT 中受益。开发者可利用其低代码界面快速定制专属智能体；研究人员能基于开源架构探索多智能体协作机制；而非技术背景用户也可直接选用预置的智能体模板，立即投入实际工作场景。\n\nAutoGPT 的技术亮点在于其模块化“积木式”工作流设计——用户通过连接功能块即可构建复杂逻辑，每个块负责单一动作，灵活且易于调试。同时，平台支持本地自托管与云端部署两种模式，兼顾数据隐私与使用便捷性。配合完善的文档和一键安装脚本，即使是初次接触的用户也能在几分钟内启动自己的第一个 AI 智能体。AutoGPT 正致力于降低 AI 应用门槛，让人人都能成为 AI 的创造者与受益者。",183572,"2026-04-20T04:47:55",[13,36,27,14,15],"语言模型",{"id":38,"name":39,"github_repo":40,"description_zh":41,"stars":42,"difficulty_score":10,"last_commit_at":43,"category_tags":44,"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":46,"name":47,"github_repo":48,"description_zh":49,"stars":50,"difficulty_score":24,"last_commit_at":51,"category_tags":52,"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 真正成长为懂上",161147,"2026-04-19T23:31:47",[14,13,36],{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":24,"last_commit_at":59,"category_tags":60,"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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":90,"forks":91,"last_commit_at":92,"license":93,"difficulty_score":94,"env_os":95,"env_gpu":96,"env_ram":95,"env_deps":97,"category_tags":102,"github_topics":103,"view_count":24,"oss_zip_url":78,"oss_zip_packed_at":78,"status":17,"created_at":109,"updated_at":110,"faqs":111,"releases":142},10129,"aymericdamien\u002FTensorFlow-Examples","TensorFlow-Examples","TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)","TensorFlow-Examples 是一套专为初学者设计的 TensorFlow 学习资源库，旨在通过丰富的实战案例帮助用户轻松入门深度学习。它解决了新手在面对庞大复杂的 TensorFlow 文档时难以找到清晰、可运行代码范例的痛点，提供了从环境配置到模型构建的全流程指导。\n\n这套教程非常适合刚接触机器学习的学生、开发者以及希望快速上手 TensorFlow 的研究人员。内容涵盖广泛，既包括\"Hello World\"和基础运算等入门练习，也深入讲解了线性回归、逻辑回归、Word2Vec 等经典算法，更提供了卷积神经网络（CNN）和循环神经网络（LSTM）等主流深度学习模型的完整实现。\n\n其独特的技术亮点在于兼顾了易用性与深度：不仅提供了基于 Jupyter Notebook 的交互式教程和详细代码注释，还同时展示了使用高层 API（如 `layers`、`model`）的现代化写法与底层原生实现，帮助用户理解框架内部机制。此外，项目已全面更新至支持 TensorFlow 2.x 版本，确保用户能学习到符合当前行业标准的最佳实践，是通往 TensorFlow 世界的一座坚实桥梁。","# TensorFlow Examples\n\nThis tutorial was designed for easily diving into TensorFlow, through examples. For readability, it includes both notebooks and source codes with explanation, for both TF v1 & v2.\n\nIt is suitable for beginners who want to find clear and concise examples about TensorFlow. Besides the traditional 'raw' TensorFlow implementations, you can also find the latest TensorFlow API practices (such as `layers`, `estimator`, `dataset`, ...).\n\n**Update (05\u002F16\u002F2020):** Moving all default examples to TF2. For TF v1 examples: [check here](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1).\n\n## Tutorial index\n\n#### 0 - Prerequisite\n- [Introduction to Machine Learning](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F0_Prerequisite\u002Fml_introduction.ipynb).\n- [Introduction to MNIST Dataset](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F0_Prerequisite\u002Fmnist_dataset_intro.ipynb).\n\n#### 1 - Introduction\n- **Hello World** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F1_Introduction\u002Fhelloworld.ipynb)). Very simple example to learn how to print \"hello world\" using TensorFlow 2.0+.\n- **Basic Operations** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F1_Introduction\u002Fbasic_operations.ipynb)). A simple example that cover TensorFlow 2.0+ basic operations.\n\n#### 2 - Basic Models\n- **Linear Regression** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Flinear_regression.ipynb)). Implement a Linear Regression with TensorFlow 2.0+.\n- **Logistic Regression** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Flogistic_regression.ipynb)). Implement a Logistic Regression with TensorFlow 2.0+.\n- **Word2Vec (Word Embedding)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Fword2vec.ipynb)). Build a Word Embedding Model (Word2Vec) from Wikipedia data, with TensorFlow 2.0+.\n- **GBDT (Gradient Boosted Decision Trees)** ([notebooks](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Fgradient_boosted_trees.ipynb)). Implement a Gradient Boosted Decision Trees with TensorFlow 2.0+ to predict house value using Boston Housing dataset.\n\n#### 3 - Neural Networks\n##### Supervised\n\n- **Simple Neural Network** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network.ipynb)). Use TensorFlow 2.0 'layers' and 'model' API to build a simple neural network to classify MNIST digits dataset.\n- **Simple Neural Network (low-level)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network_raw.ipynb)). Raw implementation of a simple neural network to classify MNIST digits dataset.\n- **Convolutional Neural Network** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network.ipynb)). Use TensorFlow 2.0+ 'layers' and 'model' API to build a convolutional neural network to classify MNIST digits dataset.\n- **Convolutional Neural Network (low-level)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network_raw.ipynb)). Raw implementation of a convolutional neural network to classify MNIST digits dataset.\n- **Recurrent Neural Network (LSTM)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Frecurrent_network.ipynb)). Build a recurrent neural network (LSTM) to classify MNIST digits dataset, using TensorFlow 2.0 'layers' and 'model' API.\n- **Bi-directional Recurrent Neural Network (LSTM)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fbidirectional_rnn.ipynb)). Build a bi-directional recurrent neural network (LSTM) to classify MNIST digits dataset, using TensorFlow 2.0+ 'layers' and 'model' API.\n- **Dynamic Recurrent Neural Network (LSTM)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdynamic_rnn.ipynb)). Build a recurrent neural network (LSTM) that performs dynamic calculation to classify sequences of variable length, using TensorFlow 2.0+ 'layers' and 'model' API.\n\n##### Unsupervised\n- **Auto-Encoder** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fautoencoder.ipynb)). Build an auto-encoder to encode an image to a lower dimension and re-construct it.\n- **DCGAN (Deep Convolutional Generative Adversarial Networks)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdcgan.ipynb)). Build a Deep Convolutional Generative Adversarial Network (DCGAN) to generate images from noise.\n\n#### 4 - Utilities\n- **Save and Restore a model** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F4_Utils\u002Fsave_restore_model.ipynb)). Save and Restore a model with TensorFlow 2.0+.\n- **Build Custom Layers & Modules** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F4_Utils\u002Fbuild_custom_layers.ipynb)). Learn how to build your own layers \u002F modules and integrate them into TensorFlow 2.0+ Models.\n- **Tensorboard** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F4_Utils\u002Ftensorboard.ipynb)). Track and visualize neural network computation graph, metrics, weights and more using TensorFlow 2.0+ tensorboard.\n\n#### 5 - Data Management\n- **Load and Parse data** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F5_DataManagement\u002Fload_data.ipynb)). Build efficient data pipeline with TensorFlow 2.0 (Numpy arrays, Images, CSV files, custom data, ...).\n- **Build and Load TFRecords** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F5_DataManagement\u002Ftfrecords.ipynb)). Convert data into TFRecords format, and load them with TensorFlow 2.0+.\n- **Image Transformation (i.e. Image Augmentation)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F5_DataManagement\u002Fimage_transformation.ipynb)). Apply various image augmentation techniques with TensorFlow 2.0+, to generate distorted images for training.\n\n#### 6 - Hardware\n- **Multi-GPU Training** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F6_Hardware\u002Fmultigpu_training.ipynb)). Train a convolutional neural network with multiple GPUs on CIFAR-10 dataset.\n\n## TensorFlow v1\n\nThe tutorial index for TF v1 is available here: [TensorFlow v1.15 Examples](tensorflow_v1). Or see below for a list of the examples.\n\n## Dataset\nSome examples require MNIST dataset for training and testing. Don't worry, this dataset will automatically be downloaded when running examples.\nMNIST is a database of handwritten digits, for a quick description of that dataset, you can check [this notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002F0_Prerequisite\u002Fmnist_dataset_intro.ipynb).\n\nOfficial Website: [http:\u002F\u002Fyann.lecun.com\u002Fexdb\u002Fmnist\u002F](http:\u002F\u002Fyann.lecun.com\u002Fexdb\u002Fmnist\u002F).\n\n## Installation\n\nTo download all the examples, simply clone this repository:\n```\ngit clone https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\n```\n\nTo run them, you also need the latest version of TensorFlow. To install it:\n```\npip install tensorflow\n```\n\nor (with GPU support):\n```\npip install tensorflow_gpu\n```\n\nFor more details about TensorFlow installation, you can check [TensorFlow Installation Guide](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F)\n\n\n## TensorFlow v1 Examples - Index\n\nThe tutorial index for TF v1 is available here: [TensorFlow v1.15 Examples](tensorflow_v1).\n\n#### 0 - Prerequisite\n- [Introduction to Machine Learning](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002Ftensorflow_v1\u002F0_Prerequisite\u002Fml_introduction.ipynb).\n- [Introduction to MNIST Dataset](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002Ftensorflow_v1\u002F0_Prerequisite\u002Fmnist_dataset_intro.ipynb).\n\n#### 1 - Introduction\n- **Hello World** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F1_Introduction\u002Fhelloworld.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F1_Introduction\u002Fhelloworld.py)). Very simple example to learn how to print \"hello world\" using TensorFlow.\n- **Basic Operations** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002Ftensorflow_v1\u002F1_Introduction\u002Fbasic_operations.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-examples\u002FExamples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002F1_Introduction\u002Fbasic_operations.py)). A simple example that cover TensorFlow basic operations.\n- **TensorFlow Eager API basics** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F1_Introduction\u002Fbasic_eager_api.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F1_Introduction\u002Fbasic_eager_api.py)). Get started with TensorFlow's Eager API.\n\n#### 2 - Basic Models\n- **Linear Regression** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flinear_regression.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flinear_regression.py)). Implement a Linear Regression with TensorFlow.\n- **Linear Regression (eager api)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flinear_regression_eager_api.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flinear_regression_eager_api.py)). Implement a Linear Regression using TensorFlow's Eager API.\n- **Logistic Regression** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flogistic_regression.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flogistic_regression.py)). Implement a Logistic Regression with TensorFlow.\n- **Logistic Regression (eager api)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flogistic_regression_eager_api.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flogistic_regression_eager_api.py)). Implement a Logistic Regression using TensorFlow's Eager API.\n- **Nearest Neighbor** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fnearest_neighbor.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fnearest_neighbor.py)). Implement Nearest Neighbor algorithm with TensorFlow.\n- **K-Means** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fkmeans.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fkmeans.py)). Build a K-Means classifier with TensorFlow.\n- **Random Forest** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Frandom_forest.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Frandom_forest.py)). Build a Random Forest classifier with TensorFlow.\n- **Gradient Boosted Decision Tree (GBDT)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fgradient_boosted_decision_tree.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fgradient_boosted_decision_tree.py)). Build a Gradient Boosted Decision Tree (GBDT) with TensorFlow.\n- **Word2Vec (Word Embedding)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fword2vec.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fword2vec.py)). Build a Word Embedding Model (Word2Vec) from Wikipedia data, with TensorFlow.\n\n#### 3 - Neural Networks\n##### Supervised\n\n- **Simple Neural Network** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002F3_NeuralNetworks\u002Fnotebooks\u002Fneural_network_raw.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fneural_network_raw.py)). Build a simple neural network (a.k.a Multi-layer Perceptron) to classify MNIST digits dataset. Raw TensorFlow implementation.\n- **Simple Neural Network (tf.layers\u002Festimator api)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fneural_network.py)). Use TensorFlow 'layers' and 'estimator' API to build a simple neural network (a.k.a Multi-layer Perceptron) to classify MNIST digits dataset.\n- **Simple Neural Network (eager api)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network_eager_api.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fneural_network_eager_api.py)). Use TensorFlow Eager API to build a simple neural network (a.k.a Multi-layer Perceptron) to classify MNIST digits dataset.\n- **Convolutional Neural Network** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network_raw.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fconvolutional_network_raw.py)). Build a convolutional neural network to classify MNIST digits dataset. Raw TensorFlow implementation.\n- **Convolutional Neural Network (tf.layers\u002Festimator api)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fconvolutional_network.py)). Use TensorFlow 'layers' and 'estimator' API to build a convolutional neural network to classify MNIST digits dataset.\n- **Recurrent Neural Network (LSTM)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Frecurrent_network.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Frecurrent_network.py)). Build a recurrent neural network (LSTM) to classify MNIST digits dataset.\n- **Bi-directional Recurrent Neural Network (LSTM)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fbidirectional_rnn.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fbidirectional_rnn.py)). Build a bi-directional recurrent neural network (LSTM) to classify MNIST digits dataset.\n- **Dynamic Recurrent Neural Network (LSTM)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdynamic_rnn.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fdynamic_rnn.py)). Build a recurrent neural network (LSTM) that performs dynamic calculation to classify sequences of different length.\n\n##### Unsupervised\n- **Auto-Encoder** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fautoencoder.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fautoencoder.py)). Build an auto-encoder to encode an image to a lower dimension and re-construct it.\n- **Variational Auto-Encoder** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fvariational_autoencoder.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fvariational_autoencoder.py)). Build a variational auto-encoder (VAE), to encode and generate images from noise.\n- **GAN (Generative Adversarial Networks)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fgan.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fgan.py)). Build a Generative Adversarial Network (GAN) to generate images from noise.\n- **DCGAN (Deep Convolutional Generative Adversarial Networks)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdcgan.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fdcgan.py)). Build a Deep Convolutional Generative Adversarial Network (DCGAN) to generate images from noise.\n\n#### 4 - Utilities\n- **Save and Restore a model** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F4_Utils\u002Fsave_restore_model.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F4_Utils\u002Fsave_restore_model.py)). Save and Restore a model with TensorFlow.\n- **Tensorboard - Graph and loss visualization** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F4_Utils\u002Ftensorboard_basic.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F4_Utils\u002Ftensorboard_basic.py)). Use Tensorboard to visualize the computation Graph and plot the loss.\n- **Tensorboard - Advanced visualization** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F4_Utils\u002Ftensorboard_advanced.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F4_Utils\u002Ftensorboard_advanced.py)). Going deeper into Tensorboard; visualize the variables, gradients, and more...\n\n#### 5 - Data Management\n- **Build an image dataset** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Fbuild_an_image_dataset.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F5_DataManagement\u002Fbuild_an_image_dataset.py)). Build your own images dataset with TensorFlow data queues, from image folders or a dataset file.\n- **TensorFlow Dataset API** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Ftensorflow_dataset_api.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F5_DataManagement\u002Ftensorflow_dataset_api.py)). Introducing TensorFlow Dataset API for optimizing the input data pipeline.\n- **Load and Parse data** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Fload_data.ipynb)). Build efficient data pipeline (Numpy arrays, Images, CSV files, custom data, ...).\n- **Build and Load TFRecords** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Ftfrecords.ipynb)). Convert data into TFRecords format, and load them.\n- **Image Transformation (i.e. Image Augmentation)** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Fimage_transformation.ipynb)). Apply various image augmentation techniques, to generate distorted images for training.\n\n#### 6 - Multi GPU\n- **Basic Operations on multi-GPU** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F6_MultiGPU\u002Fmultigpu_basics.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F6_MultiGPU\u002Fmultigpu_basics.py)). A simple example to introduce multi-GPU in TensorFlow.\n- **Train a Neural Network on multi-GPU** ([notebook](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F6_MultiGPU\u002Fmultigpu_cnn.ipynb)) ([code](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F6_MultiGPU\u002Fmultigpu_cnn.py)). A clear and simple TensorFlow implementation to train a convolutional neural network on multiple GPUs.\n\n## More Examples\nThe following examples are coming from [TFLearn](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn), a library that provides a simplified interface for TensorFlow. You can have a look, there are many [examples](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn\u002Ftree\u002Fmaster\u002Fexamples) and [pre-built operations and layers](http:\u002F\u002Ftflearn.org\u002Fdoc_index\u002F#api).\n\n### Tutorials\n- [TFLearn Quickstart](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn\u002Fblob\u002Fmaster\u002Ftutorials\u002Fintro\u002Fquickstart.md). Learn the basics of TFLearn through a concrete machine learning task. Build and train a deep neural network classifier.\n\n### Examples\n- [TFLearn Examples](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn\u002Fblob\u002Fmaster\u002Fexamples). A large collection of examples using TFLearn.\n\n","# TensorFlow 示例\n\n本教程旨在通过示例帮助您轻松入门 TensorFlow。为提高可读性，教程同时提供了带有讲解的笔记本和源代码，涵盖 TensorFlow 1.x 和 2.x 版本。\n\n它非常适合希望找到清晰简洁的 TensorFlow 示例的初学者。除了传统的“原生”TensorFlow 实现外，您还可以学习最新的 TensorFlow API 使用实践（例如 `layers`、`estimator`、`dataset` 等）。\n\n**更新（2020年5月16日）：** 所有默认示例已迁移到 TensorFlow 2。如需查看 TensorFlow 1.x 的示例，请访问：[此处](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1)。\n\n## 教程索引\n\n#### 0 - 前置知识\n- [机器学习简介](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F0_Prerequisite\u002Fml_introduction.ipynb)。\n- [MNIST 数据集简介](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F0_Prerequisite\u002Fmnist_dataset_intro.ipynb)。\n\n#### 1 - 入门\n- **Hello World** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F1_Introduction\u002Fhelloworld.ipynb))。一个非常简单的示例，用于学习如何使用 TensorFlow 2.0+ 打印“hello world”。\n- **基本操作** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F1_Introduction\u002Fbasic_operations.ipynb))。一个简单的示例，涵盖 TensorFlow 2.0+ 的基本操作。\n\n#### 2 - 基础模型\n- **线性回归** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Flinear_regression.ipynb))。使用 TensorFlow 2.0+ 实现线性回归。\n- **逻辑回归** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Flogistic_regression.ipynb))。使用 TensorFlow 2.0+ 实现逻辑回归。\n- **Word2Vec（词嵌入）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Fword2vec.ipynb))。使用 TensorFlow 2.0+，基于维基百科数据构建词嵌入模型（Word2Vec）。\n- **GBDT（梯度提升决策树）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F2_BasicModels\u002Fgradient_boosted_trees.ipynb))。使用 TensorFlow 2.0+ 实现梯度提升决策树，以波士顿住房数据集预测房价。\n\n#### 3 - 神经网络\n##### 监督学习\n- **简单神经网络** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network.ipynb))。使用 TensorFlow 2.0 的 `layers` 和 `model` API 构建一个简单的神经网络，用于分类 MNIST 数字数据集。\n- **简单神经网络（低阶实现）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network_raw.ipynb))。对 MNIST 数字数据集进行分类的简单神经网络的原始实现。\n- **卷积神经网络** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network.ipynb))。使用 TensorFlow 2.0+ 的 `layers` 和 `model` API 构建卷积神经网络，用于分类 MNIST 数字数据集。\n- **卷积神经网络（低阶实现）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network_raw.ipynb))。对 MNIST 数字数据集进行分类的卷积神经网络的原始实现。\n- **循环神经网络（LSTM）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Frecurrent_network.ipynb))。使用 TensorFlow 2.0 的 `layers` 和 `model` API 构建循环神经网络（LSTM），用于分类 MNIST 数字数据集。\n- **双向循环神经网络（LSTM）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fbidirectional_rnn.ipynb))。使用 TensorFlow 2.0+ 的 `layers` 和 `model` API 构建双向循环神经网络（LSTM），用于分类 MNIST 数字数据集。\n- **动态循环神经网络（LSTM）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdynamic_rnn.ipynb))。使用 TensorFlow 2.0+ 的 `layers` 和 `model` API 构建动态计算的循环神经网络（LSTM），用于对变长序列进行分类。\n\n##### 无监督学习\n- **自编码器** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fautoencoder.ipynb))。构建自编码器，将图像编码为低维表示并重新构造。\n- **DCGAN（深度卷积生成对抗网络）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdcgan.ipynb))。构建深度卷积生成对抗网络（DCGAN），从噪声中生成图像。\n\n#### 4 - 工具\n- **保存和恢复模型** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F4_Utils\u002Fsave_restore_model.ipynb))。使用 TensorFlow 2.0+ 保存和恢复模型。\n- **构建自定义层与模块** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F4_Utils\u002Fbuild_custom_layers.ipynb))。学习如何构建自己的层或模块，并将其集成到 TensorFlow 2.0+ 模型中。\n- **TensorBoard** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F4_Utils\u002Ftensorboard.ipynb))。使用 TensorFlow 2.0+ 的 TensorBoard 跟踪和可视化神经网络的计算图、指标、权重等。\n\n#### 5 - 数据管理\n- **加载和解析数据** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F5_DataManagement\u002Fload_data.ipynb))。使用 TensorFlow 2.0 构建高效的数据流水线（NumPy 数组、图像、CSV 文件、自定义数据等）。\n- **构建和加载 TFRecords** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F5_DataManagement\u002Ftfrecords.ipynb))。将数据转换为 TFRecords 格式，并使用 TensorFlow 2.0+ 加载。\n- **图像变换（即图像增强）** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F5_DataManagement\u002Fimage_transformation.ipynb))。使用 TensorFlow 2.0+ 应用各种图像增强技术，生成用于训练的扭曲图像。\n\n#### 6 - 硬件\n- **多 GPU 训练** ([笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v2\u002Fnotebooks\u002F6_Hardware\u002Fmultigpu_training.ipynb))。在 CIFAR-10 数据集上使用多个 GPU 训练卷积神经网络。\n\n## TensorFlow v1\n\nTF v1 的教程索引在此处提供：[TensorFlow v1.15 示例](tensorflow_v1)。或者参见下方的示例列表。\n\n## 数据集\n一些示例需要使用 MNIST 数据集进行训练和测试。不用担心，运行这些示例时，该数据集会自动下载。\nMNIST 是一个手写数字数据库。如需对该数据集的简要介绍，可以查看 [这个笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002F0_Prerequisite\u002Fmnist_dataset_intro.ipynb)。\n\n官方网站：[http:\u002F\u002Fyann.lecun.com\u002Fexdb\u002Fmnist\u002F](http:\u002F\u002Fyann.lecun.com\u002Fexdb\u002Fmnist\u002F)。\n\n## 安装\n\n要下载所有示例，只需克隆此仓库：\n```\ngit clone https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\n```\n\n要运行这些示例，您还需要最新版本的 TensorFlow。安装方法如下：\n```\npip install tensorflow\n```\n\n或者（支持 GPU）：\n```\npip install tensorflow_gpu\n```\n\n有关 TensorFlow 安装的更多详细信息，请参阅 [TensorFlow 安装指南](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F)。\n\n## TensorFlow v1 示例索引\n\nTF v1 的教程索引在此处提供：[TensorFlow v1.15 示例](tensorflow_v1)。\n\n#### 0 - 前置知识\n- [机器学习简介](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002Ftensorflow_v1\u002F0_Prerequisite\u002Fml_introduction.ipynb)。\n- [MNIST 数据集简介](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002Ftensorflow_v1\u002F0_Prerequisite\u002Fmnist_dataset_intro.ipynb)。\n\n#### 1 - 入门\n- **Hello World**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F1_Introduction\u002Fhelloworld.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F1_Introduction\u002Fhelloworld.py)）。这是一个非常简单的示例，用于学习如何使用 TensorFlow 打印“hello world”。\n- **基本操作**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Fnotebooks\u002Ftensorflow_v1\u002F1_Introduction\u002Fbasic_operations.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-examples\u002FExamples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002F1_Introduction\u002Fbasic_operations.py)）。这是一个简单的示例，涵盖了 TensorFlow 的基本操作。\n- **TensorFlow Eager API 基础**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F1_Introduction\u002Fbasic_eager_api.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F1_Introduction\u002Fbasic_eager_api.py)）。开始使用 TensorFlow 的 Eager API。\n\n#### 2 - 基本模型\n- **线性回归**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flinear_regression.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flinear_regression.py)）。使用 TensorFlow 实现线性回归。\n- **线性回归（Eager API）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flinear_regression_eager_api.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flinear_regression_eager_api.py)）。使用 TensorFlow 的 Eager API 实现线性回归。\n- **逻辑回归**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flogistic_regression.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flogistic_regression.py)）。使用 TensorFlow 实现逻辑回归。\n- **逻辑回归（Eager API）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Flogistic_regression_eager_api.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Flogistic_regression_eager_api.py)）。使用 TensorFlow 的 Eager API 实现逻辑回归。\n- **最近邻算法**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fnearest_neighbor.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fnearest_neighbor.py)）。使用 TensorFlow 实现最近邻算法。\n- **K-Means 聚类**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fkmeans.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fkmeans.py)）。使用 TensorFlow 构建 K-Means 分类器。\n- **随机森林**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Frandom_forest.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Frandom_forest.py)）。使用 TensorFlow 构建随机森林分类器。\n- **梯度提升决策树（GBDT）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fgradient_boosted_decision_tree.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fgradient_boosted_decision_tree.py)）。使用 TensorFlow 构建梯度提升决策树（GBDT）。\n- **Word2Vec（词嵌入）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F2_BasicModels\u002Fword2vec.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F2_BasicModels\u002Fword2vec.py)）。使用 Wikipedia 数据，通过 TensorFlow 构建词嵌入模型（Word2Vec）。\n\n#### 3 - 神经网络\n##### 监督学习\n\n- **简单神经网络**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002F3_NeuralNetworks\u002Fnotebooks\u002Fneural_network_raw.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fneural_network_raw.py)）。构建一个简单的神经网络（即多层感知机），用于对MNIST手写数字数据集进行分类。原始TensorFlow实现。\n- **简单神经网络（tf.layers\u002Festimator API）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fneural_network.py)）。使用TensorFlow的‘layers’和‘estimator’API，构建一个简单的神经网络（即多层感知机），用于对MNIST手写数字数据集进行分类。\n- **简单神经网络（eager API）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fneural_network_eager_api.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fneural_network_eager_api.py)）。使用TensorFlow Eager API，构建一个简单的神经网络（即多层感知机），用于对MNIST手写数字数据集进行分类。\n- **卷积神经网络**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network_raw.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fconvolutional_network_raw.py)）。构建一个卷积神经网络，用于对MNIST手写数字数据集进行分类。原始TensorFlow实现。\n- **卷积神经网络（tf.layers\u002Festimator API）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fconvolutional_network.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fconvolutional_network.py)）。使用TensorFlow的‘layers’和‘estimator’API，构建一个卷积神经网络，用于对MNIST手写数字数据集进行分类。\n- **循环神经网络（LSTM）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Frecurrent_network.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Frecurrent_network.py)）。构建一个循环神经网络（LSTM），用于对MNIST手写数字数据集进行分类。\n- **双向循环神经网络（LSTM）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fbidirectional_rnn.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fbidirectional_rnn.py)）。构建一个双向循环神经网络（LSTM），用于对MNIST手写数字数据集进行分类。\n- **动态循环神经网络（LSTM）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdynamic_rnn.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fdynamic_rnn.py)）。构建一个循环神经网络（LSTM），能够对不同长度的序列进行动态计算并分类。\n\n##### 无监督学习\n- **自编码器**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fautoencoder.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fautoencoder.py)）。构建一个自编码器，将图像编码为低维表示，并将其重构。\n- **变分自编码器**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fvariational_autoencoder.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fvariational_autoencoder.py)）。构建一个变分自编码器（VAE），用于从噪声中编码和生成图像。\n- **GAN（生成对抗网络）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fgan.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fgan.py)）。构建一个生成对抗网络（GAN），用于从噪声中生成图像。\n- **DCGAN（深度卷积生成对抗网络）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F3_NeuralNetworks\u002Fdcgan.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F3_NeuralNetworks\u002Fdcgan.py)）。构建一个深度卷积生成对抗网络（DCGAN），用于从噪声中生成图像。\n\n#### 4 - 工具类\n- **保存与恢复模型**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F4_Utils\u002Fsave_restore_model.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F4_Utils\u002Fsave_restore_model.py)）。使用TensorFlow保存和恢复模型。\n- **TensorBoard - 图形与损失可视化**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F4_Utils\u002Ftensorboard_basic.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F4_Utils\u002Ftensorboard_basic.py)）。使用TensorBoard可视化计算图并绘制损失曲线。\n- **TensorBoard - 高级可视化**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F4_Utils\u002Ftensorboard_advanced.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F4_Utils\u002Ftensorboard_advanced.py)）。深入探索TensorBoard；可视化变量、梯度等更多内容……\n\n#### 5 - 数据管理\n- **构建图像数据集**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Fbuild_an_image_dataset.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F5_DataManagement\u002Fbuild_an_image_dataset.py)）。使用 TensorFlow 数据队列，从图像文件夹或数据集文件中构建您自己的图像数据集。\n- **TensorFlow Dataset API**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Ftensorflow_dataset_api.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F5_DataManagement\u002Ftensorflow_dataset_api.py)）。介绍 TensorFlow Dataset API，用于优化输入数据流水线。\n- **加载和解析数据**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Fload_data.ipynb)）。构建高效的数据流水线（NumPy 数组、图像、CSV 文件、自定义数据等）。\n- **构建并加载 TFRecords**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Ftfrecords.ipynb)）。将数据转换为 TFRecords 格式，并加载它们。\n- **图像变换（即图像增强）**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F5_DataManagement\u002Fimage_transformation.ipynb)）。应用各种图像增强技术，生成用于训练的扭曲图像。\n\n#### 6 - 多 GPU\n- **多 GPU 上的基本操作**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F6_MultiGPU\u002Fmultigpu_basics.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F6_MultiGPU\u002Fmultigpu_basics.py)）。一个简单的示例，介绍 TensorFlow 中的多 GPU 使用。\n- **在多 GPU 上训练神经网络**（[笔记本](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fnotebooks\u002F6_MultiGPU\u002Fmultigpu_cnn.ipynb)）（[代码](https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fblob\u002Fmaster\u002Ftensorflow_v1\u002Fexamples\u002F6_MultiGPU\u002Fmultigpu_cnn.py)）。一个清晰且简单的 TensorFlow 实现，用于在多个 GPU 上训练卷积神经网络。\n\n\n\n## 更多示例\n以下示例来自 [TFLearn](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn)，这是一个为 TensorFlow 提供简化接口的库。您可以查看其中的许多 [示例](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn\u002Ftree\u002Fmaster\u002Fexamples) 和 [预构建的操作与层](http:\u002F\u002Ftflearn.org\u002Fdoc_index\u002F#api)。\n\n### 教程\n- [TFLearn 快速入门](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn\u002Fblob\u002Fmaster\u002Ftutorials\u002Fintro\u002Fquickstart.md)。通过一个具体的机器学习任务学习 TFLearn 的基础知识。构建并训练一个深度神经网络分类器。\n\n### 示例\n- [TFLearn 示例](https:\u002F\u002Fgithub.com\u002Ftflearn\u002Ftflearn\u002Fblob\u002Fmaster\u002Fexamples)。大量使用 TFLearn 的示例集合。","# TensorFlow-Examples 快速上手指南\n\n本指南基于 `TensorFlow-Examples` 开源项目，旨在帮助开发者通过清晰的代码示例快速掌握 TensorFlow 2.x 的核心用法。项目涵盖了从基础操作、经典机器学习模型到深度神经网络（CNN, RNN, GAN 等）的完整实现。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：推荐 Python 3.6 - 3.9\n*   **前置依赖**：\n    *   `git`：用于克隆代码仓库\n    *   `pip`：Python 包管理工具\n    *   `Jupyter Notebook` (可选)：用于运行 `.ipynb` 格式的教程笔记\n*   **硬件建议**：\n    *   基础示例：普通 CPU 即可运行\n    *   深度学习\u002F多 GPU 示例：建议配备 NVIDIA GPU 并安装对应的 CUDA 驱动\n\n## 安装步骤\n\n### 1. 克隆项目仓库\n使用以下命令将示例代码下载到本地：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\ncd TensorFlow-Examples\n```\n\n> **国内加速提示**：如果访问 GitHub 速度较慢，可使用国内镜像源（如 Gitee 镜像，若有）或配置代理。\n\n### 2. 安装 TensorFlow\n项目默认基于 **TensorFlow 2.x**。根据您的硬件环境选择安装命令：\n\n**方案 A：仅 CPU 版本（通用）**\n```bash\npip install tensorflow\n```\n\n**方案 B：GPU 支持版本（需具备 NVIDIA 显卡）**\n```bash\npip install tensorflow-gpu\n```\n\n> **国内源加速**：推荐使用清华源或阿里源加速安装：\n> ```bash\n> pip install tensorflow -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n### 3. 安装其他依赖（可选）\n部分笔记可能需要 `matplotlib`, `numpy`, `pandas` 等库，通常 TensorFlow 会自带部分依赖。如有缺失，可执行：\n```bash\npip install jupyter matplotlib numpy pandas\n```\n\n## 基本使用\n\n本项目提供了两种主要的使用方式：直接运行 Python 脚本或使用 Jupyter Notebook 交互式学习。\n\n### 方式一：运行 Hello World 示例\n这是最简单的入门示例，用于验证环境是否配置正确。\n\n1. 进入示例目录：\n```bash\ncd tensorflow_v2\u002Fnotebooks\u002F1_Introduction\n```\n\n2. 运行基础操作示例（以 Python 脚本为例，若目录下为 notebook 请使用 `jupyter notebook` 打开）：\n如果您想直接测试 TensorFlow 是否正常工作，可以在终端运行以下简短代码：\n\n```python\nimport tensorflow as tf\n\n# 打印 TensorFlow 版本\nprint(\"TensorFlow version:\", tf.__version__)\n\n# 简单的张量计算\nhello = tf.constant('Hello, TensorFlow!')\nprint(hello.numpy())\n```\n\n### 方式二：使用 Jupyter Notebook 学习\n这是本项目推荐的学习方式，包含详细的代码解释和运行结果。\n\n1. 启动 Jupyter Notebook：\n```bash\njupyter notebook\n```\n*(注：请在项目根目录或 `tensorflow_v2\u002Fnotebooks` 目录下运行此命令)*\n\n2. 在浏览器中导航至感兴趣的教程，例如：\n   *   **基础入门**：`1_Introduction\u002Fhelloworld.ipynb`\n   *   **线性回归**：`2_BasicModels\u002Flinear_regression.ipynb`\n   *   **卷积神经网络**：`3_NeuralNetworks\u002Fconvolutional_network.ipynb`\n\n3. 点击单元格按 `Shift + Enter` 依次运行代码。\n   *   *注意*：首次运行涉及数据集（如 MNIST）的示例时，系统会自动下载数据，请保持网络连接畅通。\n\n### 核心学习路径推荐\n按照以下顺序循序渐进：\n1.  **Prerequisite**：了解机器学习基础与 MNIST 数据集。\n2.  **Introduction**：掌握 TF 2.x 的基本运算与 eager execution。\n3.  **Basic Models**：实践线性回归、逻辑回归等传统算法。\n4.  **Neural Networks**：深入 CNN、RNN\u002FLSTM 及生成对抗网络（GAN）。\n5.  **Utilities & Data Management**：学习模型保存、自定义层及高效数据管道构建。","某初创公司的数据科学实习生小李，需要在两周内为电商客户构建一个基于用户评论的情感分析原型，但他对 TensorFlow 2.0 的新 API 尚不熟悉。\n\n### 没有 TensorFlow-Examples 时\n- **环境配置迷茫**：面对 TF v1 与 v2 的语法差异，小李在官方文档中反复横跳，花费大量时间排查版本兼容性错误，导致项目启动严重滞后。\n- **数据预处理受阻**：缺乏标准的 `dataset` API 参考，他手动编写了低效且易错的数据加载代码，难以处理大规模的文本清洗任务。\n- **模型搭建试错成本高**：试图从零实现 LSTM 网络时，因不熟悉 `layers` 和 `model` 的高级封装，多次遭遇维度不匹配报错，调试过程极其痛苦。\n- **最佳实践缺失**：由于找不到规范的训练循环示例，代码结构混乱，不仅运行效率低下，还难以向团队展示可复用的成果。\n\n### 使用 TensorFlow-Examples 后\n- **快速上手新特性**：直接复用 \"Hello World\" 和 \"Basic Operations\" 笔记，小李迅速掌握了 TF 2.0 的核心语法，当天便完成了环境搭建与基础验证。\n- **高效数据流水线**：参考 MNIST 数据集的处理范例，他快速构建了基于 `tf.data` 的高效输入管道，轻松实现了文本数据的批量加载与预处理。\n- **标准化模型构建**：依托 \"Recurrent Neural Network (LSTM)\" 的完整源码，他直接移植了成熟的网络架构，将原本需要三天的建模工作压缩至半天完成。\n- **代码质量显著提升**：遵循示例中的模块化写法，最终交付的原型代码清晰规范，既包含了最新的 API 实践，又便于团队成员后续迭代维护。\n\nTensorFlow-Examples 通过提供从入门到进阶的标准化代码范例，将初学者从繁琐的底层调试中解放出来，使其能专注于业务逻辑与模型创新。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faymericdamien_TensorFlow-Examples_404f7bfc.png","aymericdamien","Aymeric Damien","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Faymericdamien_53883e1d.png","Deep Learning Enthusiast. MLE @Snapchat. Past: Tsinghua University, EISTI","@Snapchat","Sunnyvale, CA",null,"https:\u002F\u002Ftwitter.com\u002FAymericDamien","https:\u002F\u002Fgithub.com\u002Faymericdamien",[82,86],{"name":83,"color":84,"percentage":85},"Jupyter Notebook","#DA5B0B",98.6,{"name":87,"color":88,"percentage":89},"Python","#3572A5",1.4,43784,14762,"2026-04-19T20:55:43","NOASSERTION",1,"未说明","非必需。支持 CPU 运行；若需 GPU 加速，需安装 tensorflow_gpu（具体显卡型号、显存大小及 CUDA 版本未在文中明确说明，仅提及有多 GPU 训练示例）",{"notes":98,"python":95,"dependencies":99},"默认示例基于 TensorFlow 2.0+，TensorFlow 1.x 示例需单独查看指定目录。部分示例（如 MNIST）会在首次运行时自动下载数据集。提供多 GPU 训练示例，但未指定具体硬件门槛。",[100,101],"tensorflow","tensorflow_gpu (可选)",[14],[100,104,105,106,107,108],"tutorial","examples","deep-learning","python","machine-learning","2026-03-27T02:49:30.150509","2026-04-20T19:22:22.876694",[112,117,122,127,132,137],{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},45471,"如何将 TensorFlow Tensor 转换为 NumPy 数组？","在 TensorFlow 1.x 中，需要在会话（Session）中运行评估。使用代码：`array = your_tensor.eval(session=your_session)`。如果使用了占位符（placeholder），可能还需要提供 `feed_dict` 参数来喂养数据。注意：如果在 tf.function 装饰的函数内部或 TensorFlow 2.x 的急切执行模式下，可以直接调用 `.numpy()` 方法（例如 `tensor.numpy()`），但在旧版静态图模式下必须使用 `.eval()`。","https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fissues\u002F40",{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},45472,"运行示例代码时出现 'TypeError: unsupported operand type(s) for +: dict_values and dict_values' 错误怎么办？","这是因为示例代码最初是为 Python 2.7 编写的，而在 Python 3.x 中，字典的 `.values()` 方法返回的是 `dict_values` 对象而不是列表，因此不能直接使用 `+` 连接。解决方法是将代码中的 `trainable_variables = weights.values() + biases.values()` 修改为 `trainable_variables = list(weights.values()) + list(biases.values())`，显式地将字典值转换为列表后再相加。","https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fissues\u002F356",{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},45473,"使用 tf.nn.sparse_softmax_cross_entropy_with_logits 时遇到 'Rank mismatch' 维度不匹配错误如何解决？","该错误通常是因为标签（labels）的维度不正确。`sparse_softmax_cross_entropy_with_logits` 要求标签是一维的（形状为 `[batch_size]`），而代码中可能定义为了二维（如 `[batch_size, 1]`）。解决方法是检查目标值 y 的定义，将其形状从 `(None, 1)` 改为 `(None)`。例如：将 `y = tf.placeholder(dtype=tf.int32, shape=(None, 1))` 修改为 `y = tf.placeholder(dtype=tf.int32, shape=(None))`。不要随意使用 `tf.argmax` 处理标签，除非标签原本是 one-hot 编码且你需要转换格式。","https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fissues\u002F224",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},45474,"导入 TensorFlow 时提示 'ImportError: No module named tensorflow' 怎么办？","这表示当前 Python 环境中未安装 TensorFlow。请根据使用的 Python 版本执行安装命令：\n1. 对于 Python 3.x，建议使用 pip3：`sudo pip3 install tensorflow`。\n2. 如果有 GPU 并需要 GPU 支持：`sudo pip3 install tensorflow-gpu`。\n3. 如果是 Python 2.x 或默认环境：`sudo pip install tensorflow` 或 `pip install tensorflow`。\n安装完成后，确保在运行脚本的同一环境中执行代码。","https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fissues\u002F92",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},45475,"如何在训练和测试阶段使用不同的 n_steps（时间步长）值？","在基于静态图的 TensorFlow 1.x 模型中，如果计算图中使用了 `tf.split` 等操作且分割数量硬编码为训练时的 `n_steps`，则无法直接在测试时更改该值，因为这会导致图结构冲突（如 'Number of ways to split should evenly divide the split dimension' 错误）。通常的解决方案是：\n1. 在构建图时使用动态形状或占位符来控制分割逻辑，而不是全局常量。\n2. 或者，重新构建一个用于推理的图，其中 `n_steps` 设置为测试所需的值，然后恢复训练好的权重进行测试。\n直接重置全局变量 `n_steps` 通常无效，因为图在 `sess.run` 之前已经编译完成。","https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fissues\u002F36",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},45476,"如何在 TensorFlow 中实现双向 LSTM（Bi-Directional LSTM）？","虽然原始 Issue 标题请求添加双向 LSTM 示例，但通用的实现方法是使用 `tf.nn.bidirectional_dynamic_rnn`（TF 1.x）或 `tf.keras.layers.Bidirectional`（TF 2.x\u002FKeras）。\n在 TF 1.x 中，代码结构通常如下：\n```python\nfw_cell = tf.nn.rnn_cell.LSTMCell(num_units)\nbw_cell = tf.nn.rnn_cell.LSTMCell(num_units)\noutputs, states = tf.nn.bidirectional_dynamic_rnn(fw_cell, bw_cell, inputs, sequence_length=seq_len, dtype=tf.float32)\n```\n这将分别处理正向和反向序列，并输出组合结果。建议查阅官方文档中关于 `bidirectional_dynamic_rnn` 的具体用法以适配具体网络结构。","https:\u002F\u002Fgithub.com\u002Faymericdamien\u002FTensorFlow-Examples\u002Fissues\u002F9",[]]