title: Get epoch inside keras optimizer
body: <p>I am writing a custom optimizer for keras and I need to update a variable after each epoch, however keras only appears to allow me to update it after each training iteration (basically after each batch). Is there any default way to do this so I do not have to specify the batch size to the optimizer manually? </p>