2016-11-15 70 views
1

继MNIST在TensorFlow ML初学者,我们学会了最基本的SGD与学习率0.5,批量大小为100和1000层的步骤是这样TensorFlow上一个简单的SGD的CNTK等价物是什么?

train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)` 
... 
for i in range(1000): 
    batch_xs, batch_ys = mnist.train.next_batch(100) 
    sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys}) 

在CNTK,直观相当于

SGD = { 
    minibatchSize = 100 
    maxEpochs = 1000 
    learningRatesPerMB = 0.5 
} 

看起来它正在做更多的计算,至少它肯定更详细。

minibatch时代在CNTK从我所看到的,也是它把学习率的方式不同的概念。

显示的TensorFlow中基本SGD的直接等价(或最接近可能)是什么?每个框架之间如何转换每个概念?

回答

1

它看起来像TensorFlow和CNTK有小批量相同的定义:

'Minibatch size' in CNTK means the number of samples processed between model updates 

的时代是CNTK是simialr一步TensorFlow,即有多少会议上火车运运行。

maxEpochs: maximum number of epochs to run. 

的learningRatesPerMB是有点不同的充:

this will be converted into learningRatesPerSample by dividing the values by the specified 'minibatchSize' 

learningRatesPerSample类似于TensorFlow的学习速度。

关于SGD的CNTK文档:https://github.com/Microsoft/CNTK/wiki/SGD-Block