I am reading tensorflow documentation now and I can not understand what does "batch" and "batch_size" mean in explanation skip-gram model. Please, can someone explain me?

Here this paragraph:

Recall that skip-gram inverts contexts and targets, and tries to predict each context word from its target word, so the task becomes to predict 'the' and 'brown' from 'quick', 'quick' and 'fox' from 'brown', etc. Therefore our dataset becomes

(quick, the), (quick, brown), (brown, quick), (brown, fox), ...

of (input, output) pairs. The objective function is defined over the entire dataset, but we typically optimize this with stochastic gradient descent (SGD) using one example at a time (or a 'minibatch' of batch_size examples, where typically 16 <= batch_size <= 512).


1 Answer 1


A minibatch, is a group of (input,output) pairs that you present to your neural net in one pass (or epoch), without computing the stochastic gradient descent between two pairs (you only do it at the end of the minibatch, summing the errors over the pairs). This improve the speed and prevent over learning on single elements, thus improving learning. It also doesn't need to much memory since your batches are "mini".

Some people call stochastic training when your mini-batch has a size of 1, and batch training when it has the size of your training dataset.

You can get some nice explanations here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.