Deep Learning Frameworks

This is my blog.

《Improving Deep Neural Networks》第三周时,提及了一下框架

单独开一篇,待后续一个一个补啦~

choosing deep learning frameworks

  • Ease of programming(development and deployment)
  • Running speed
  • Truly open(open source with good governance)

kinds

以字母序为顺序

Caffe/Caffe2

CNTK

DL4J

Keras

Lasagne

mxnet

PaddlePaddle

TensorFlow

试体验:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import numpy as np
import tensorflow as tf
w = tf.Variable(0, dtype=tf.float32)
"""
# w^2-10w+25
# cost = tf.add(tf.add(w**2,tf.multiply(-10., w)), 25)
# tensorflow已经重载了运算符,这样也是可以的
cost = w**2 - 10* w + 25
"""
# 更一般的
coefficients = np.array([[1.], [-20.], [100.]])
x = tf.placeholder(tf.float32, [3,1])
cost = x[0][0]*w**2 + x[1][0]* w + x[2][0]
# 0.01是学习速率,目标是最小化代价函数cost
train=tf.train.GradientDescentOptimizer(0.01).minimize(cost)
# 初始化
init = tf.global_variables_initializer()
"""
session = tf.Session()
session.run(init)
# 迭代多次
for i in range(1000):
# session.run(train)
session.run(train, feed_dict={x:coefficients})
# output
print(session.run(w))
"""
# 当有内循环出现的时候,用with在清理的时候会更优秀一些
with tf.Session() as session:
session.run(init)
for i in range(1000):
session.run(train, feed_dict={x:coefficients})
print(session.run(w))

Theano

Torch

后记

雾霾越来越大了呢

健身房里人也越来越多了

羡慕室友的小腹肌

转载请注明出处,谢谢。

愿 我是你的小太阳

买糖果去喽