Skip to content

Data and training

Epochs, batch size and learning rate

The three training settings you will change most often, and how to tell when they are wrong.

On this page

The idea in one minute

Training repeats a simple loop: the model makes guesses, measures how wrong they were (the loss), and adjusts its weights a little. Three settings control that loop.

SettingStudio labelMeaning
EpochTraining cyclesOne full pass over all training data
Batch sizeBatch sizeHow many examples the model looks at before each adjustment
Learning rateLearning rateHow big each adjustment is

Training cycles (epochs)

  • Too few: the model has not learned enough yet. Training and validation accuracy are both low (underfitting).
  • Too many: the model starts memorising the training data. Training accuracy keeps rising while validation accuracy stops improving or drops (overfitting).

Batch size

  • A small batch (e.g. 16) gives more frequent, noisier updates.
  • A large batch (e.g. 64) gives smoother updates but uses more memory.

The default of 32 works well for most projects.

Learning rate

  • Too high (e.g. 0.1): the loss jumps around and may never settle.
  • Too low (e.g. 0.00001): training is very slow.
  • A common starting value is 0.001.

A simple example

You train a Motion model with 60 training cycles, batch size 32 and learning rate 0.001. Your training set has 640 windows:

  • One cycle has 640 ÷ 32 = 20 adjustments (steps).
  • 60 cycles is up to 60 × 20 = 1,200 adjustments, unless early stopping ends training sooner.

Reading the training graphs

What you seeWhat it meansTry
Both accuracies still rising at the endNot finished learningMore training cycles
Training accuracy high, validation much lowerOverfittingMore data, fewer cycles
Loss jumps up and down a lotLearning rate too highLower the learning rate
Accuracy barely movesLearning rate too low, or features don't separate the labelsRaise the learning rate, or try a different processing block

Where you use this in PetalEdge