Calculate the number of training steps in one epoch from dataset and batch size.
The number of optimizer steps in one epoch is the dataset size divided by the batch size, rounded up (ceil) if the final partial batch is still processed, or rounded down (floor) if it's dropped. Most training loops default to processing the final partial batch (steps = ceil(dataset_size / batch_size)), which is why the last batch of an epoch is often smaller than the configured batch size unless the dataset size divides evenly.
steps_per_epoch = ceil(dataset_size / batch_size) [or floor if drop_last=True]
Enable it when your training code uses drop_last=True (common in PyTorch DataLoader) to keep every batch the exact same size — useful for batch-norm statistics or fixed-shape hardware kernels — at the cost of not seeing a small fraction of the data each epoch.
Unless dataset_size is an exact multiple of batch_size, the last batch in an epoch contains the remainder, e.g. 100 samples with batch size 32 gives three full batches of 32 plus one final batch of 4.
This calculator solves for steps per epoch directly from dataset and batch size; the Epoch Calculator uses that relationship in reverse to convert between a total step budget and an equivalent number of epochs.
It changes how many optimizer updates occur, but not how many micro-batches are read — if you want optimizer steps per epoch under accumulation, divide this result by your accumulation step count.