Learn Before
Concept

An Example of Mini-Batches

If you have a huge training set with 5000000 training samples, X=[ x^{(1)}, x^{(2)} ,..., x^{(5000000)}] Let's say each of your baby training sets have just 1,000 examples each. So, you take the first mini-batch as X^{{ 1}} =[x^{(1)}, x^{(2)} ,..., x^{(1000)}]. And then you take home the next 1,000 samples X{2}=[x(1001),...,x(2000)]X^{\{2\}} =[x^{(1001)}, ..., x^{(2000)}] and so on.

Altogether you would have 5,000 of these mini-batches and then similarly you do the same thing for Y. Hence we end up with mini-batches X{T},Y{T}X^{\{ T\}}, Y^{\{ T\}}, T = 1,2...,5000.

0

2

Updated 2026-06-12

Tags

Data Science

Machine Learning Yearning @ DeepLearning.AI

Dive into Deep Learning @ D2L

Deep Learning

Machine Learning

Supervised Learning