CNTK 等同于 TensorFlow 上的简单 SGD 是什么?
What is the CNTK equivalent of a simple SGD on TensorFlow?
按照MNIST for ML beginners in TensorFlow,我们学习了最基本的SGD,学习率0.5,batch size 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 中的 minibatch 和 epochs 有不同的概念,还有它对待学习率的方式。
显示的 TensorFlow 中基本 SGD 的直接等价物(或最接近的可能物)是什么?每个概念如何在每个框架之间转换?
看起来 TensorFlow 和 CNTK 对小批量的定义相同:
'Minibatch size' in CNTK means the number of samples processed between model updates
CNTK 的纪元类似于 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
按照MNIST for ML beginners in TensorFlow,我们学习了最基本的SGD,学习率0.5,batch size 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 中的 minibatch 和 epochs 有不同的概念,还有它对待学习率的方式。
显示的 TensorFlow 中基本 SGD 的直接等价物(或最接近的可能物)是什么?每个概念如何在每个框架之间转换?
看起来 TensorFlow 和 CNTK 对小批量的定义相同:
'Minibatch size' in CNTK means the number of samples processed between model updates
CNTK 的纪元类似于 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