【问题标题】:What is the CNTK equivalent of a simple SGD on TensorFlow?TensorFlow 上的简单 SGD 的 CNTK 等价物是什么?
【发布时间】:2016-11-15 18:44:48
【问题描述】:

按照 TensorFlow 中 ML 初学者的 MNIST,我们学习了最基本的 SGD,学习率为 0.5,批量大小为 100,步数为 1000,如下所示

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
}

看起来它在做更多的计算,至少它肯定更冗长。

在 CNTK 中 minibatchepochs 的概念与我所看到的不同,它处理学习率的方式也是如此。

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

【问题讨论】:

    标签: tensorflow cntk


    【解决方案1】:

    看起来 TensorFlow 和 CNTK 对 mini batch 的定义是一样的:

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

    时代是 CNTK 类似于 step in TensorFlow,即在 train op 上运行了多少会话。

    maxEpochs: maximum number of epochs to run.
    

    learningRatesPerMB 有点不同:

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

    learningRatesPerSample 类似于 TensorFlow 的学习率。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-14
      • 2019-11-11
      • 2019-03-24
      • 1970-01-01
      • 2017-06-05
      • 1970-01-01
      • 2022-06-22
      相关资源
      最近更新 更多