我正在尝试学习TensorFlow,研究以下示例:https://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/3_NeuralNetworks/autoencoder.ipynb
然后我对下面的代码有一些问题:
for epoch in range(training_epochs):
# Loop over all batches
for i in range(total_batch):
batch_xs, batch_ys = mnist.train.next_batch(batch_size)
# Run optimization op (backprop) and cost op (to get loss value)
_, c = sess.run([optimizer, cost], feed_dict={X: batch_xs})
# Display logs per epoch step
if epoch % display_step == 0:
print("Epoch:", '%04d' % (epoch+1),
"cost=", "{:.9f}".format(c))
因为mnist只是一个数据集,mnist.train.next_batch
到底是什么意思?dataset.train.next_batch
是如何定义的呢?
谢谢!
DataSet._index_in_epoch
来跟踪当前处于哪个 epoch 中,例如mnist.train._index_in_epoch
。 - Yibo Yang