liveBook · Manning

Epoch

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

An epoch is one iteration or pass of a machine-learning training procedure over its training process or data.

An epoch is one complete training iteration over the configured training process or data. The epochs setting controls how long model fitting runs, alongside parameters such as learning rate, batch size, and data_step. section 5.1.1

In practical training experiments, epochs serve several roles:

  • Set a fixed training budget, such as 500 epochs while comparing model size, data quantity, batch size, and learning rate. section 5.1.1
  • Limit training during evolutionary architecture search; three epochs make repeated candidate evaluation brief, but may leave the resulting model diverging. section 7.5
  • Trade training durability against computation: increasing epochs can improve the evolved model’s training assessment while substantially increasing evolution time. section 7.5
Listing 5.1 EDL_5_1_Hyperparameter_Tuning.ipynb: Hyperparameters
hp_test = "test 1" #@param {type:"string"}    #1
learning_rate = 3.5e-03
epochs = 500
middle_layer = 25
 
batch_size = 2                                #2
 
data_step = 1                                 #3

A notebook parameter cell exposes epochs beside learning rate, model width, batch size, and data_step, making the training budget easy to change experimentally. section 5.1.1

Listing 7.22 EDL_7_5_Evo_CNN.ipynb: The compile and train functions
def compile_train(model):
  model.compile(optimizer='adam',
              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
              metrics=['accuracy'])       #1
  model.fit(x_train, y_train, epochs=3,   #2
                    verbose=0)
  return model

The training function fixes model.fit at three epochs, showing how epoch count becomes part of repeated candidate evaluation. section 7.5

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Demonstrates epoch-count effects through notebook settings and experiments, but does not develop training-loop internals.
Examples
Uses 500-epoch hyperparameter comparisons and three-epoch CNN candidate training during five-generation evolution.
What it assumes
Assumes familiarity with model training and hyperparameter adjustment, while keeping the epoch setting directly configurable.
What you can do after
Operate/configure notebook training runs by changing epochs and weighing model durability against computation time.
How it connects
Connects epochs with hyperparameters, batch size, learning rate, model architecture, evolutionary optimization, and training time.

Also explained in

Compare how 10 books explain epoch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.