Machine learning 在输入fn中实现minibatch

Machine learning 在输入fn中实现minibatch,machine-learning,tensorflow,deep-learning,Machine Learning,Tensorflow,Deep Learning,我目前正在Tensorflow中试用新的高级tf.contrib.learn API,方法是移植inception-v3再培训脚本中的以下功能: 我可以知道如何在每次迭代中复制验证和培训输入的小批量采样,如原始retain.py中所示吗 目前我尝试在input\u fn函数中使用tf.train.shuffle\u batch,但我不确定它是否有效 为清晰起见,请参阅一些代码片段 def train_input_fn(): # Get a batch of input bottlenec

我目前正在Tensorflow中试用新的高级tf.contrib.learn API,方法是移植inception-v3再培训脚本中的以下功能:

我可以知道如何在每次迭代中复制验证和培训输入的小批量采样,如原始retain.py中所示吗

目前我尝试在input\u fn函数中使用tf.train.shuffle\u batch,但我不确定它是否有效

为清晰起见,请参阅一些代码片段

def train_input_fn():
    # Get a batch of input bottleneck values, either calculated fresh every
    # time with distortions applied, or from the cache stored on disk.
    if do_distort_images:
        (train_bottleneck_outputs, train_ground_truths) = get_random_distorted_bottlenecks(
                sess, image_lists, -1, 'training',
                FLAGS.image_dir, distorted_jpeg_data_tensor,
                distorted_image_tensor, resized_image_tensor, bottleneck_tensor)
    else:
        (train_bottleneck_outputs, train_ground_truths, _) = get_random_cached_bottlenecks(
                sess, image_lists, -1, 'training',
                FLAGS.bottleneck_dir, FLAGS.image_dir, jpeg_data_tensor,
                bottleneck_tensor)
    return tf.train.shuffle_batch([tf.constant(train_bottleneck_outputs),
                                     tf.constant(train_ground_truths)],
                                      batch_size=FLAGS.train_batch_size, capacity=1100,
                                      min_after_dequeue=1000, enqueue_many=True, num_threads=2)

你提供了正确的教程链接吗?哦,是的,我发布了错误的链接。谢谢你的提醒