TensorLayer : The Fastest Deep Learning Library for TensorFlow
来源:互联网 发布:2009的淘宝店 编辑:程序博客网 时间:2024/06/04 23:24
Single GTX 980 GPU with CUDA 7.5 , cuDNN 5 / batch_size = 500 / MNIST / 784-800-800-10 / Epoch Time
TensorFlow 是非常强大的分布式跨平台深度学习框架;
因此,我们有必要比较一下基于 TensorFlow 开发的三个库 :Keras, TensorLayer, Tflearn
Keras:是这三个库中最早发布的,最开始只支持 Theano,16年初开始同时支持 Theano 和 TensorFlow 。它的优点是提供傻瓜式编程风格,一分钟可以上手。
有中英文文档。
缺点是框架封闭太死,难以自定义,比如 Activation 的设置是输入string来实现的,而TensorLayer是直接输入function,这样自定义 function 时非常方便。
model = Sequential()
model.add(Dropout(0.2, input_shape=(784,)))
model.add(Dense(800))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(800))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(10))
model.add(Activation('softmax'))
TensorLayer:是16年中发布的,相对较晚但也较为先进。它的优点是速度最快,速度和完全用 TensorFlow 写的代码一样。
同时提供傻瓜式编程方法,和专业级编程方法。参考:tutorial_mnist_simple.py tutorial_mnist.py
提供很多高级功能,适合分布式和嵌入式应用,如:variable reuse ,same model to npz file,GPU manager 等等。
提供大量官方教程,包含了 TensorFlow 官方所有深度学习教程的模块化实现,集合教学和编程于一体。
有中英文文档。
缺点是发布较晚,16年6月前只限作者的学校内部使用,所以现在才开始积累用户。
network = tl.layers.InputLayer(x, name='input_layer')
network = tl.layers.DropoutLayer(network, keep=0.8, name='drop1')
network = tl.layers.DenseLayer(network, n_units=800,
act = tf.nn.relu, name='relu1')
network = tl.layers.DropoutLayer(network, keep=0.5, name='drop2')
network = tl.layers.DenseLayer(network, n_units=800,
act = tf.nn.relu, name='relu2')
network = tl.layers.DropoutLayer(network, keep=0.5, name='drop3')
network = tl.layers.DenseLayer(network, n_units=10,
act = tl.activation.identity,
name='output_layer')
Tflearn:的作者在陌陌工作,亮点和keras一样,都提供傻瓜式编程方法,但由相比Keras透明,所以运行速度比Keras快。
缺点是不支持 Seq2seq,高级应用没法做。。这个bug比较大,希望尽快修复。
input_layer = tflearn.input_data(shape=[None, 784])
dropout1 = tflearn.dropout(input_layer, 0.8)
dense1 = tflearn.fully_connected(input_layer, 800, activation='relu',
regularizer='L2', weight_decay=0.0)
dropout2 = tflearn.dropout(dense1, 0.5)
dense2 = tflearn.fully_connected(dropout1, 800, activation='relu',
regularizer='L2', weight_decay=0.0)
dropout3 = tflearn.dropout(dense2, 0.5)
softmax = tflearn.fully_connected(dropout3, 10, activation='softmax')
- TensorLayer : The Fastest Deep Learning Library for TensorFlow
- 翻译 | Keras : Deep Learning library for Tensorflow and Theano
- 「Deep Learning」Ubuntu 14.04+Anaconda2+Caffe+OpenCV2+TensorFlow+TensorLayer+Keras+Pytorch
- 【TensorLayer】建立在TensorFlow上的深度学习(Deep Learning)与增强学习(Reinforcement Learning) 软件库
- deep learning on tensorflow
- Multi-Class Classification Tutorial with the Keras Deep Learning Library
- Deep Learning algorithms with TensorFlow
- 【Deep Learning】Tensorflow MNIST测试
- Deep Learning for Beginners
- Deep Learning for OCR
- 【CS 20SI】TensorFlow for Deep Learning Research Lecture note 2: TensorFlow Ops
- How to Use the Keras Functional API for Deep Learning
- 【Deep Learning】笔记:Tips for deep learning
- TensorFlow 和 TensorLayer
- TensorFlow与TensorLayer
- Deep Learning for Chatbots, Part 2 – Implementing a Retrieval-Based Model in Tensorflow
- Deep Learning for Chatbots, Part 2 – Implementing a Retrieval-Based Model in Tensorflow
- deep learning for NLP courses
- 曾经做过的c练习(16-20)
- [C/C++笔面试]编程实现字符串中各单词的翻转
- iOS推送开关
- 【Git】Eclipse上Git忽略文件不起作用
- 贪心法基础
- TensorLayer : The Fastest Deep Learning Library for TensorFlow
- 日志管理
- poj 1741 Tree(给定一棵树,对于两个不同的节点a,b,满足dist(a,b,)<=k的点对数)
- 浅谈标准I/O缓冲区
- net嵌入页面的几种方法
- Oracle Instant Client(即时客户端) 安装与配置
- 木块问题(vector)-UVa 101
- 最长公共子序列(LCS---动态规划)
- Jquery通过append新元素之后事件绑定问题的解决方案