ReduceLROnPlateau callback in Keras seems to be an interesting tool to use in training models. But I could not really figure out exactly what the cooldown parameter means in the callback function ReduceLROnPlateau in Keras.
Here is what the documentation says:
First, the interface of the function:
keras.callbacks.ReduceLROnPlateau(monitor='val_loss',
factor=0.1,
patience=10,
verbose=0,
mode='auto',
min_delta=0.0001,
cooldown=0,
min_lr=0)
ReduceLROnPlateau: Models often benefit from reducing the learning rate by a factor of 2-10 once learning stagnates. This callback monitors a quantity and if no improvement is seen for a 'patience' number of epochs, the learning rate is reduced.
cooldown: number of epochs to wait before resuming normal operation after lr has been reduced.
The explanation does not really make it clear to me. Is it meant here that:
- Say that lr=A. And the learning rate is reduced if the relevant monitored metric does not improve during patience number of epochs. (And say that lr=B after reducing it.)
- And the learning rate is set to its first value (lr=A again) after cooldown number of epochs.
Is my understanding correct? If not, what is the real function of cooldown parameter here?
PS. When I google it, I see some examples where people set the cooldown parameter to zero, which makes me think that my perception on this parameter is wrong.