Is there any smart way to use feed_dict and create batches on the fly. Is there anything under the hood that might help. So my training data is loaded into lists, but is not batched. Is there any smart way that I can select a batch at random with feed_dict, without having to pre-batch the data.
For example I have:
for i in range(N_STEPS):
sess.run(train_step, feed_dict={x_: X, y_: Y})
Where X and Y are the inputs and outputs of a standard NN and the length of X is the number of training examples. What do people suggest for creating batches?
This, I thought may do the trick, below, but there has to be something more elegant?
batch = random.randrange(0, len(X)-N_BATCH)
sess.run(train_step, feed_dict={x_: X[batch:batch+N_BATCH], y_: Y[batch:batch+N_BATCH]})