干货 | TensorFlow的55个经典案例
转自1024深度学习
导语:本文是TensorFlow实现流行机器学习算法的教程汇集,目标是让读者可以轻松通过清晰简明的案例深入了解 TensorFlow。这些案例适合那些想要实现一些 TensorFlow 案例的初学者。本教程包含还包含笔记和带有注解的代码。
第一步:给TF新手的教程指南
1:tf初学者需要明白的入门准备
机器学习入门笔记:
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
2:tf初学者需要了解的入门基础
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
3:tf初学者需要掌握的基本模型
最近邻:
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
4:tf初学者需要尝试的神经网络
多层感知器:
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
5:tf初学者需要精通的实用技术
保存和恢复模型
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:tf初学者需要的懂得的多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
6:案例需要的数据集
有一些案例需要 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/
第二步:为TF新手准备的各个类型的案例、模型和数据集
初步了解:TFLearn TensorFlow
接下来的示例来自TFLearn,这是一个为 TensorFlow 提供了简化的接口的库。里面有很多示例和预构建的运算和层。
使用教程:TFLearn 快速入门。通过一个具体的机器学习任务学习 TFLearn 基础。开发和训练一个深度神经网络分类器。
TFLearn地址:https://github.com/tflearn/tflearn
示例:https://github.com/tflearn/tflearn/tree/master/examples
预构建的运算和层:http://tflearn.org/doc_index/#api
笔记: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) 。应用于 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
第三步:为TF新手准备的其他方面内容
Recommender-Wide&Deep Network,推荐系统中 wide & deep 网络的教学示例:
https://github.com/tflearn/tflearn/blob/master/examples/others/recommender_wide_and_deep.py
Spiral Classification Problem,对斯坦福 CS231n spiral 分类难题的 TFLearn 实现:
https://github.com/tflearn/tflearn/blob/master/examples/notebooks/spiral.ipynb
层,与 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
干货 | TensorFlow的55个经典案例的更多相关文章
- (zhuan) 资源|TensorFlow初学者必须了解的55个经典案例
资源|TensorFlow初学者必须了解的55个经典案例 2017-05-27 全球人工智能 >>>>>>欢迎投稿:news@top25.cn<<< ...
- 100个Linux Shell脚本经典案例(附PDF)
转载自:https://mp.weixin.qq.com/s/tCKAM67_7K7q2vJthaIsDQ 原文链接:https://wenku.baidu.com/view/4f089430a116 ...
- Linux运维之道(大量经典案例、问题分析,运维案头书,红帽推荐)
Linux运维之道(大量经典案例.问题分析,运维案头书,红帽推荐) 丁明一 编 ISBN 978-7-121-21877-4 2014年1月出版 定价:69.00元 448页 16开 编辑推荐 1 ...
- 阿里云资深DBA专家罗龙九:云数据库十大经典案例分析【转载】
阿里云资深DBA专家罗龙九:云数据库十大经典案例分析 2016-07-21 06:33 本文已获阿里云授权发布,转载具体要求见文末 摘要:本文根据阿里云资深DBA专家罗龙九在首届阿里巴巴在线峰会的&l ...
- Python递归的经典案例
目录 : 一.递归的简介 二.递归的经典应用 2.1 递归求阶乘 2.2 递归推斐波那契数列 2.3 二分法找有序列表指定值 2.4 递归解汉诺塔 前言: 当我们碰到诸如需要求阶乘或斐 ...
- javascript的理解及经典案例
js的简介: JavaScript是一种能让你的网页更加生动活泼的程式语言,也是目前网页中设计中最容易学又最方便的语言. 你可以利用JavaScript轻易的做出亲切的欢迎讯息.漂亮的数字钟.有广告效 ...
- jQuery基础的工厂函数以及定时器的经典案例
1. jQuery的基本信息: 1.1 定义: jQuery是JavaScript的程序库之一,它是JavaScript对象和实用函数的封装, 1.2 作用: 许多使用JavaScript能实现的交 ...
- 经典案例:那些让人赞不绝口的创新 HTML5 网站
在过去的10年里,网页设计师使用 Flash.JavaScript 或其他复杂的软件和技术来创建网站.但现在你可以前所未有的快速.轻松地设计或创造互动的.有趣好看的网站.如何创建?答案是 HTML5 ...
- Altera OpenCL用于计算机领域的13个经典案例(转)
英文出自:Streamcomputing 转自:http://www.csdn.net/article/2013-10-29/2817319-the-application-areas-opencl- ...
随机推荐
- vue点击实现 路由的跳转
点击按钮实现路由的跳转 <div @click="gotoMenu">按钮</div> 实现跳转 methods: { gotoMenu(){ //跳转到上 ...
- uwsgi部署django,里的request调用的接口响应慢解决方法
解决方法,增加2个线程 uwsgi.ini 配置如下 chdir=/var/www/Ultramanpidfile=/tmp/uwsgi.pidmodule=Ultraman.wsgimaster=t ...
- NOIP2015 DAY2 T1跳石头
传送门 题目背景 一年一度的“跳石头”比赛又要开始了! 题目描述 这项比赛将在一条笔直的河道中进行,河道中分布着一些巨大岩石.组委会已经选择好了两块岩石作为比赛起点和终点.在起点和终点之间,有 N 块 ...
- [luogu2624 HNOI2008]明明的烦恼 (prufer+高精)
传送门 Solution 根据prufer序列做的题,具体可以看这里 还知道了一种避免高精除的方法quq Code #include <cmath> #include <cstdio ...
- Linux思维导图之文本工具、正则
习题巩固: 1,找出的ifconfig"网卡名"命令结果中本机的IPv4的地址 2,查出分区空间使用率的最大百分比值 3,查出用户UID最大值的用户名,UID及壳类型 4,查出的/ ...
- 获取元素属性中的[x] 标签: javascript 2016-12-24 22:35 105人阅读 评论(0)
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...
- Docker学习总结(16)——当当网Docker应用实践
随着Docker成为当下热门的容器技术,各大公司以及中小团队都开始选择Docker来进行应用部署,从原有部署方式迁移到Docker方式过程中难免会遇到各种问题,本次分享主要介绍当当网个性化推荐组应用D ...
- 华为USG6550 MIB CPU MEM
https://www.cnblogs.com/vincent-liang/p/7785089.html
- win10使用WampServer部署magento
1.安装wampserver及php.apache.mySQL组件,访问http://www.wampserver.com/en/#download-wrapper,下载以下文件并依次安装: ...
- HDOJ 题目5097 Page Rank(矩阵运算,模拟)
Page Rank Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 100000/100000 K (Java/Others) Tota ...