这是使用 TensorFlow 实现流行的机器学习算法的教程汇集。本汇集的目标是让读者可以轻松通过案例深入 TensorFlow。

这些案例适合那些想要清晰简明的 TensorFlow 实现案例的初学者。本教程还包含了笔记和带有注解的代码。

  • 项目地址: https://github.com/aymericdamien/TensorFlow-Examples

教程索引

0 - 先决条件

机器学习入门:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/0_Prerequisite/ml_introduction.ipynb

  • MNIST 数据集入门

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/0_Prerequisite/mnist_dataset_intro.ipynb

1 - 入门

Hello World:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/1_Introduction/helloworld.ipynb

  • 代码 https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1_Introduction/helloworld.py

基本操作:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/1_Introduction/basic_operations.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/1_Introduction/basic_operations.py

2 - 基本模型

最近邻:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/2_BasicModels/nearest_neighbor.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/nearest_neighbor.py

线性回归:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/2_BasicModels/linear_regression.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/linear_regression.py

Logistic 回归:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/2_BasicModels/logistic_regression.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/logistic_regression.py

3 - 神经网络

多层感知器:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/multilayer_perceptron.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/multilayer_perceptron.py

卷积神经网络:

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/convolutional_network.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/convolutional_network.py

循环神经网络(LSTM):

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/recurrent_network.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/recurrent_network.py

双向循环神经网络(LSTM):

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/bidirectional_rnn.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/bidirectional_rnn.py

动态循环神经网络(LSTM)

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/dynamic_rnn.py

自编码器

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/autoencoder.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/autoencoder.py

4 - 实用技术

保存和恢复模型

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/4_Utils/save_restore_model.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/save_restore_model.py

图和损失可视化

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/4_Utils/tensorboard_basic.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/tensorboard_basic.py

Tensorboard——高级可视化

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/4_Utils/tensorboard_advanced.py

5 - 多 GPU

多 GPU 上的基本操作

  • 笔记: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/5_MultiGPU/multigpu_basics.ipynb

  • 代码: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/5_MultiGPU/multigpu_basics.py

数据集

一些案例需要 MNIST 数据集进行训练和测试。不要担心,运行这些案例时,该数据集会被自动下载下来(使用 input_data.py) 。MNIST 是一个手写数字的数据库,查看这个笔记了解关于该数据集的描述: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/0_Prerequisite/mnist_dataset_intro.ipynb

  • 官方网站: http://yann.lecun.com/exdb/mnist/

更多案例

接下来的示例来自 TFLearn ,这是一个为 TensorFlow 提供了简化的接口的库。你可以看看,这里有很多示例和预构建的运算和层。

  • 示例: https://github.com/tflearn/tflearn/tree/master/examples

  • 预构建的运算和层: http://tflearn.org/doc_index/#api

教程

TFLearn 快速入门。通过一个具体的机器学习任务学习 TFLearn 基础。开发和训练一个深度神经网络分类器。

  • 笔记:<https://github.com/tflearn/tflearn/blob/master/tutorials/intro/quickstart.md

基础

  • 线性回归,使用 TFLearn 实现线性回归: https://github.com/tflearn/tflearn/blob/master/examples/basics/linear_regression.py

  • 逻辑运算符。使用 TFLearn 实现逻辑运算符: https://github.com/tflearn/tflearn/blob/master/examples/basics/logical.py

  • 权重保持。保存和还原一个模型: https://github.com/tflearn/tflearn/blob/master/examples/basics/weights_persistence.py

  • 微调。在一个新任务上微调一个预训练的模型: https://github.com/tflearn/tflearn/blob/master/examples/basics/finetuning.py

  • 使用 HDF5。使用 HDF5 处理大型数据集: https://github.com/tflearn/tflearn/blob/master/examples/basics/use_hdf5.py

  • 使用 DASK。使用 DASK 处理大型数据集: https://github.com/tflearn/tflearn/blob/master/examples/basics/use_dask.py

计算机视觉

  • 多层感知器。一种用于 MNIST 分类任务的多层感知实现: https://github.com/tflearn/tflearn/blob/master/examples/images/dnn.py

  • 卷积网络(MNIST)。用于分类 MNIST 数据集的一种卷积神经网络实现: https://github.com/tflearn/tflearn/blob/master/examples/images/convnet_mnist.py

  • 卷积网络(CIFAR-10)。用于分类 CIFAR-10 数据集的一种卷积神经网络实现: https://github.com/tflearn/tflearn/blob/master/examples/images/convnet_cifar10.py

  • 网络中的网络。用于分类 CIFAR-10 数据集的 Network in Network 实现: https://github.com/tflearn/tflearn/blob/master/examples/images/network_in_network.py

  • Alexnet。将 Alexnet 应用于 Oxford Flowers 17 分类任务: https://github.com/tflearn/tflearn/blob/master/examples/images/alexnet.py

  • VGGNet。将 VGGNet 应用于 Oxford Flowers 17 分类任务: https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network.py

  • VGGNet Finetuning (Fast Training)。使用一个预训练的 VGG 网络并将其约束到你自己的数据上,以便实现快速训练: https://github.com/tflearn/tflearn/blob/master/examples/images/vgg_network_finetuning.py

  • RNN Pixels。使用 RNN(在像素的序列上)分类图像: https://github.com/tflearn/tflearn/blob/master/examples/images/rnn_pixels.py

  • Highway Network。用于分类 MNIST 数据集的 Highway Network 实现: https://github.com/tflearn/tflearn/blob/master/examples/images/highway_dnn.py

  • Highway Convolutional Network。用于分类 MNIST 数据集的 Highway Convolutional Network 实现: https://github.com/tflearn/tflearn/blob/master/examples/images/convnet_highway_mnist.py

  • Residual Network (MNIST) ( https://github.com/tflearn/tflearn/blob/master/examples/images/residual_network_mnist.py ).。应用于 MNIST 分类任务的一种瓶颈残差网络(bottleneck residual network): https://github.com/tflearn/tflearn/blob/master/examples/images/residual_network_mnist.py

  • Residual Network (CIFAR-10)。应用于 CIFAR-10 分类任务的一种残差网络: https://github.com/tflearn/tflearn/blob/master/examples/images/residual_network_cifar10.py

  • Google Inception(v3)。应用于 Oxford Flowers 17 分类任务的谷歌 Inception v3 网络: https://github.com/tflearn/tflearn/blob/master/examples/images/googlenet.py

  • 自编码器。用于 MNIST 手写数字的自编码器: https://github.com/tflearn/tflearn/blob/master/examples/images/autoencoder.py

自然语言处理

  • 循环神经网络(LSTM),应用 LSTM 到 IMDB 情感数据集分类任务: https://github.com/tflearn/tflearn/blob/master/examples/nlp/lstm.py

  • 双向 RNN(LSTM),将一个双向 LSTM 应用到 IMDB 情感数据集分类任务: https://github.com/tflearn/tflearn/blob/master/examples/nlp/bidirectional_lstm.py

  • 动态 RNN(LSTM),利用动态 LSTM 从 IMDB 数据集分类可变长度文本: https://github.com/tflearn/tflearn/blob/master/examples/nlp/dynamic_lstm.py

  • 城市名称生成,使用 LSTM 网络生成新的美国城市名: https://github.com/tflearn/tflearn/blob/master/examples/nlp/lstm_generator_cityname.py

  • 莎士比亚手稿生成,使用 LSTM 网络生成新的莎士比亚手稿: https://github.com/tflearn/tflearn/blob/master/examples/nlp/lstm_generator_shakespeare.py

  • Seq2seq,seq2seq 循环网络的教学示例: https://github.com/tflearn/tflearn/blob/master/examples/nlp/seq2seq_example.py

  • CNN Seq,应用一个 1-D 卷积网络从 IMDB 情感数据集中分类词序列: https://github.com/tflearn/tflearn/blob/master/examples/nlp/cnn_sentence_classification.py

强化学习

Atari Pacman 1-step Q-Learning,使用 1-step Q-learning 教一台机器玩 Atari 游戏: https://github.com/tflearn/tflearn/blob/master/examples/reinforcement_learning/atari_1step_qlearning.py

其他

Recommender-Wide&Deep Network,推荐系统中 wide & deep 网络的教学示例: https://github.com/tflearn/tflearn/blob/master/examples/others/recommender_wide_and_deep.py

Notebooks

  • Spiral Classification Problem,对斯坦福 CS231n spiral 分类难题的 TFLearn 实现: https://github.com/tflearn/tflearn/blob/master/examples/notebooks/spiral.ipynb

可延展的 TensorFlow

  • 层,与 TensorFlow 一起使用  TFLearn 层: https://github.com/tflearn/tflearn/blob/master/examples/extending_tensorflow/layers.py

  • 训练器,使用 TFLearn 训练器类训练任何 TensorFlow 图: https://github.com/tflearn/tflearn/blob/master/examples/extending_tensorflow/layers.py

  • Bulit-in Ops,连同 TensorFlow 使用 TFLearn built-in 操作: https://github.com/tflearn/tflearn/blob/master/examples/extending_tensorflow/builtin_ops.py

  • Summaries,连同 TensorFlow 使用 TFLearn summarizers: https://github.com/tflearn/tflearn/blob/master/examples/extending_tensorflow/summaries.py

  • Variables,连同 TensorFlow 使用 TFLearn Variables: https://github.com/tflearn/tflearn/blob/master/examples/extending_tensorflow/variables.py


来自:http://www.jiqizhixin.com/article/1648

TensorFlow实现流行的机器学习算法教程相关推荐

  1. 10种流行的机器学习算法进行泰坦尼克幸存者分析

    还记得上世纪轰动全球的泰坦尼克吗? 1912年4月,正在处女航的泰坦尼克号在撞上冰山后沉没,2224名乘客和机组人员中有1502人遇难,这场悲剧轰动全球,遇难的一大原因正式没有足够的就剩设备给到船上的 ...

  2. 目前流行的机器学习算法

    目前在机器学习领域流行的算法有很多,常见的有: 深度学习(Deep Learning)算法: 包括卷积神经网络(Convolutional Neural Network, CNN).循环神经网络(Re ...

  3. 深度学习算法和机器学习算法_啊哈! 4种流行的机器学习算法的片刻

    深度学习算法和机器学习算法 Most people are either in two camps: 大多数人都在两个营地中: I don't understand these machine lea ...

  4. 机器学习算法如何应用于控制_将机器学习算法应用于NBA MVP数据

    机器学习算法如何应用于控制 A step-by-step tutorial in R R中的分步教程 1引言 (1 Introduction) This blog makes up the Machi ...

  5. python的分类算法有哪些_Python8种最常见火爆的机器学习算法

    原标题:Python8种最常见火爆的机器学习算法 毋庸置疑,近来机器学习人气日益高涨,逐渐在流行词榜单上占据一席之地.机器学习算法繁多,到底该选择哪一种处理相关数据是困扰很多学习者的问题.本文将以一种 ...

  6. 机器学习算法基础知识

    在我们了解了需要解决的机器学习问题的类型之后,我们可以开始考虑搜集来的数据的类型以及我们可以尝试的机器学习算法.在这个帖子里,我们会介绍一遍最流行的机器学习算法.通过浏览主要的算法来大致了解可以利用的 ...

  7. 机器学习算法_五分钟了解机器学习十大算法

    本文为有志于成为数据科学家或对此感兴趣的读者们介绍最流行的机器学习算法. 机器学习是该行业的一个创新且重要的领域.我们为机器学习程序选择的算法类型,取决于我们想要实现的目标. 现在,机器学习有很多算法 ...

  8. scaling之旅_机器学习算法之旅

    在这篇文章中, 我们将介绍最流行的机器学习算法. 浏览该领域的主要算法以了解可用的方法有哪些是有用的. 有很多算法是可用的, 当算法名称被抛出时, 它会让人感到无所适从, 而你只需要知道它们是什么以及 ...

  9. 机器学习算法 --- Decision Trees Algorithms

    一.Decision Trees Agorithms的简介 决策树算法(Decision Trees Agorithms),是如今最流行的机器学习算法之一,它即能做分类又做回归(不像之前介绍的其他学习 ...

最新文章

  1. 云+技术沙龙:计算机视觉的原理及最佳实践
  2. Java注解--Java深度历险(转)
  3. 基于应用日志的扫描器检测实践
  4. matlab lu分解求线性方程组_计算方法(二)直接三角分解法解线性方程组
  5. oracle数据导入sqlldr小例子
  6. 技术做不下去就转管理?没那么容易
  7. 【英语学习】【WOTD】lacuna 释义/词源/示例
  8. printf(%d,5.01)和printf(%f,5)的输出结果
  9. ado.net知识点博客网址
  10. PHP基础--PDO的常用操作
  11. Codevs 均分纸牌(贪心)
  12. 实现一个文本文件的解析类(vector,字符串解析的应用)
  13. Android开发布局 案例一
  14. 群体智能优化算法之粒子群优化算法
  15. jeesit框架通过jBox获取弹窗信息
  16. mac下安装pyaudio
  17. ubuntu22.04在虚拟机中的安装过程以及搜狗输入法的安装
  18. Excel怎么忽略位置对比两列数据是否相同
  19. Oracle数据库存储number类型数据
  20. python关键词排名批量查排名_[代码全屏查看]-Python 批量获取Baidu关键词的排名并入库...

热门文章

  1. Leetcode 142. Linked List Cycle IIJAVA语言
  2. 【李宏毅2020 ML/DL】P88-96 Meta Learning – MAML | Reptile
  3. centos6.x文本操作
  4. archman linux教程,Archman GNU/Linux 2020-01 发布,基于Arch的Xfce桌面发行版
  5. 微博爬取显示全文_Python爬虫---chrome driver爬取微博(教你几十行代码爬取财宝宝微博长文)...
  6. 关于vmware中的centos无法ping通宿主机或者是外网的解决思路
  7. XenApp 6安装过程中的两个常见错误
  8. java基础算法题(入门题与简单题)
  9. 秀米复制到公众号格式变了_公众号文章下载神器!支持批量、多格式,可下载历史全部文章...
  10. 基于WirёGuαrd和UDP speeder的网游加速实现方案