Commands for Generating Mini-Batch for Tensorflow Learning

Asked 3 months ago, Updated 3 months ago, 6 views

I'm trying to create a multilayer NN for tensorflow, but I've looked it up a lot, but I don't know the command to generate a mini-batch from the original data.For example
Could you tell me the command to randomly generate 100 mini-batch from data X (1000 rows, 10 columns) teacher data Y (1000 rows, 1 column)?

python tensorflow

2022-09-30 11:08

1 Answers

It can be achieved by the shuffle_batch() function.
https://www.tensorflow.org/api_docs/python/tf/train/shuffle_batch

Instructions for use are described below.
https://www.tensorflow.org/programmers_guide/reading_data

example_batch, label_batch=tf.train.shuffle_batch(
  [example, label], batch_size=batch_size, capacity=capacity,
  min_after_dequeue = min_after_dequeue)


2022-09-30 11:08

If you have any answers or tips


© 2023 OneMinuteCode. All rights reserved.