What are "sample", "batch", and "epoch"?

What are "sample", "batch", and "epoch"?

In order to use Keras correctly, the following are some common definitions that must be understood and understood:
• Sample: sample, an element in a data set, a piece of data.
• Example 1: In a convolutional neural network, an image is a sample.
• Example 2: In the speech recognition model, a piece of audio is a sample.
• Batch: Batch, a collection of N samples. The samples of each batch are processed independently and in parallel. During training,
the result of a batch will only be used to update the model once. -A batch of samples is usually closer to
the distribution of the overall input data than a single input . The larger the batch, the closer it is. However, each batch will take longer to process
and still only update the model once. In reasoning (evaluation/prediction), it is recommended to choose a
batch as large as possible if the conditions permit (because a larger batch usually evaluates/predicts faster).
• Epoch: Round, usually defined as "an iteration over the entire data set", used in different stages of training, which
is conducive to recording and regular evaluation.
• When using evaluation_data or evaluation_split in the fit method of the Keras model, the evaluation will
run at the end of each epoch.
• In Keras, you can add special callbacks to run at the end of the epoch. Examples include learning rate changes
and model checkpoints (save).

Guess you like

Origin blog.csdn.net/as1490047935/article/details/105059229