I've been trying to understand Keras'
Optimizer
class, and realize that there's a variable I don't quite understand - self.iterations
. Does this refer to:
It's 2.
The entire keras function is iterated once per batch.
One way to test is to get a small array of data and train for one epoch:
#get 3 batches of size 32 from the data
small_X = X_train[:3*32]
small_Y = Y_train[:3*32]
#print the initial value of iterations
print(keras.backend.eval(model.optimizer.iterations))
#train for 1 epoch with batch size 32
model.fit(small_X, small_Y, epochs=1, batch_size=32, verbose=0)
#see the new value of iterations
print(keras.backend.eval(model.optimizer.iterations))