• 简单粗暴 TensorFlow 2.0 | A Concise Handbook of TensorFlow 2.0
    • Indices and tables

    简单粗暴 TensorFlow 2.0 | A Concise Handbook of TensorFlow 2.0

    基于Eager Execution | Based on Eager Execution

    这是一本简明的 TensorFlow 2.0 入门指导手册,基于 Keras 和 Eager Execution(即时运行)模式,力图让具备一定机器学习及Python基础的开发者们快速上手TensorFlow 2.0。

    本手册的所有代码基于 TensorFlow 2.0 正式版及 beta1 版本。文中的所有示例代码可至 这里 获得。

    本手册正于TensorFlow官方微信公众号(TensorFlow_official)连载,可点此查看 连载文章目录 。本手册的英文版仍在翻译中。请访问 https://v1.tf.wiki 以查看本手册上一版的英文版。本手册是 Google Summer of Code 2019 项目之一。

    GitHub: https://github.com/snowkylin/tensorflow-handbook

    This is a concise handbook of TensorFlow 2.0 based on Keras and Eager Execution mode, aiming to help developers with some basic machine learning and Python knowledge to get started with TensorFlow 2.0 quickly.

    The code of this handbook is based on TensorFlow 2.0 stable version or beta1 version. All sample code in this handbook can be viewed here .

    The English version of this handbook is still in progress. Please refer to https://v1.tf.wiki for the eariler version. This handbook is a project of Google Summer of Code 2019.

    GitHub: https://github.com/snowkylin/tensorflow-handbook

    目录

    • 前言
      • 本书的适用群体
      • 如何使用本书
      • 致谢
    • TensorFlow概述
      • 学生和研究者:模型的建立与训练
      • 开发者和工程师:模型的调用与部署
      • TensorFlow能帮助我们做什么?

    基础

    • TensorFlow安装与环境配置
      • 一般安装步骤
      • GPU版本TensorFlow安装指南
        • GPU硬件的准备
        • NVIDIA驱动程序的安装
        • CUDA Toolkit和cnDNN的安装
      • 第一个程序
      • IDE设置
      • TensorFlow所需的硬件配置 *
    • TensorFlow基础
      • TensorFlow 1+1
      • 自动求导机制
      • 基础示例:线性回归
        • NumPy下的线性回归
        • TensorFlow下的线性回归
    • TensorFlow 模型建立与训练
      • 模型(Model)与层(Layer)
      • 基础示例:多层感知机(MLP)
        • 数据获取及预处理: tf.keras.datasets
        • 模型的构建: tf.keras.Modeltf.keras.layers
        • 模型的训练: tf.keras.lossestf.keras.optimizer
        • 模型的评估: tf.keras.metrics
      • 卷积神经网络(CNN)
        • 使用Keras实现卷积神经网络
        • 使用Keras中预定义的经典卷积神经网络结构
      • 循环神经网络(RNN)
      • 深度强化学习(DRL)
      • Keras Pipeline *
        • Keras Sequential/Functional API 模式建立模型
        • 使用 Keras Model 的 compilefitevaluate 方法训练和评估模型
      • 自定义层、损失函数和评估指标 *
        • 自定义层
        • 自定义损失函数和评估指标
    • TensorFlow常用模块
      • tf.train.Checkpoint :变量的保存与恢复
      • TensorBoard:训练过程可视化
      • tf.data :数据集的构建与预处理
        • 数据集对象的建立
        • 数据集对象的预处理
        • 数据集元素的获取与使用
        • 实例:cats_vs_dogs图像分类
      • @tf.function :Graph Execution模式 *
        • @tf.function 基础使用方法
        • @tf.function 内在机制
        • AutoGraph:将Python控制流转换为TensorFlow计算图
        • 使用传统的 tf.Session
      • tf.TensorArray :TensorFlow 动态数组 *
      • tf.config:GPU的使用与分配 *
        • 指定当前程序使用的GPU
        • 设置显存使用策略
        • 单GPU模拟多GPU环境

    部署

    • TensorFlow模型导出
      • 使用SavedModel完整导出模型
      • Keras Sequential save方法(Jinpeng)
    • TensorFlow Serving
      • TensorFlow Serving安装
      • TensorFlow Serving模型部署
        • Keras Sequential模式模型的部署
        • 自定义Keras模型的部署
      • 在客户端调用以TensorFlow Serving部署的模型
        • Python客户端示例
        • Node.js客户端示例(Ziyang)
    • TensorFlow Lite(Jinpeng)
      • 模型转换
      • Android部署
      • Quantization模型转换
      • 总结
    • TensorFlow in JavaScript(Huan)
      • TensorFlow.js 简介
        • 浏览器中使用 TensorFlow.js 的优势
        • TensorFlow.js 性能对比
      • TensorFlow.js 环境配置
        • 在浏览器中使用 TensorFlow.js
        • 在 Node.js 中使用 TensorFlow.js
        • 在微信小程序中使用 TensorFlow.js
      • TensorFlow.js 模型部署
        • 通过 TensorFlow.js 加载 Python 模型
        • 使用 TensorFlow.js 模型库
      • TensorFlow.js 模型训练 *

    大规模训练与加速

    • TensorFlow分布式训练
      • 单机多卡训练: MirroredStrategy
      • 多机训练: MultiWorkerMirroredStrategy
    • 使用TPU训练TensorFlow模型(Huan)
      • TPU 简介
        • 什么是 TPU
        • 为什么使用 TPU
        • TPU 性能
      • TPU 环境配置
        • 免费 TPU:Google Colab
        • Cloud TPU
      • TPU 基础使用

    扩展

    • TensorFlow Hub 模型复用(Jinpeng)
    • TensorFlow Datasets 数据集载入
    • Swift for TensorFlow (S4TF) (Huan)
      • S4TF 简介
        • 为什么要使用 Swift 进行 Tensorflow 开发
      • S4TF 环境配置
        • 本地安装 Swift for Tensorflow
        • 在 Colaboratory 中快速体验 Swift for Tensorflow
        • 在 Docker 中快速体验 Swift for TensorFlow
      • S4TF 基础使用
        • 在 Swift 中使用标准的 TensorFlow API
        • 在 Swift 中直接加载 Python 语言库
        • 语言原生支持自动微分
        • MNIST数字分类
    • TensorFlow in Julia(Ziyang)
      • TensorFlow.jl 简介
        • 为什么要使用 Julia ?
      • TensorFlow.jl 环境配置
        • 在 docker 中快速体验 TensorFlow.jl
        • 在 julia 包管理器中安装 TensorFlow.jl
      • TensorFlow.jl 基础使用
        • MNIST数字分类

    附录

    • 图模型下的TensorFlow
      • TensorFlow 1+1
      • 基础示例:线性回归
    • 使用Docker部署TensorFlow环境
    • 在云端使用TensorFlow
      • 在Colab中使用TensorFlow
      • 在Google Cloud Platform(GCP)中使用TensorFlow
        • 在Compute Engine建立带GPU的实例并部署TensorFlow
        • 使用AI Platform中的Notebook建立带GPU的在线JupyterLab环境
      • 在阿里云上使用 GPU 实例运行 Tensorflow(Ziyang)
    • 部署自己的交互式Python开发环境JupyterLab
    • TensorFlow性能优化
    • 参考资料与推荐阅读
    • 术语中英对照表

    答疑区

    • (中文)TensorFlow中文社区“简单粗暴TensorFlow”版面: https://www.tensorflowers.cn/b/48 (中文的疑问和建议请来此处,将以中文回答和讨论。欢迎使用中文的开发者们前来TensorFlow中文社区交流讨论)

    • (英文)https://github.com/snowkylin/tensorflow-handbook/releases (英文的疑问或建议可在GitHub issue中提出,会以英文回答)

    PDF下载(旧版):

    • 中文版:https://www.tensorflowers.cn/t/6230 (同时也有英文版下载)

    • 英文版:https://github.com/snowkylin/tensorflow-handbook/releases

    GitHub: https://github.com/snowkylin/tensorflow-handbook

    Q&A area

    • (Chinese) TensorFlow Chinese community “A Concise Handbook of TensorFlow” forum: https://www.tensorflowers.cn/b/48

    • (English) https://github.com/snowkylin/tensorflow-handbook/issues

    PDF download (old version):

    • Chinese version: https://www.tensorflowers.cn/t/6230

    • English version: https://github.com/snowkylin/tensorflow-handbook/releases

    GitHub: https://github.com/snowkylin/tensorflow-handbook

    Indices and tables

    • 索引

    • 模块索引

    • 搜索页面

    Flag Counter