def on_batch_begin(self, batch, logs=None):
    'Executes before step begins.'
    lr = self.schedule(self.epochs, batch, self.steps_per_epoch, self.batch_size)
    if (not isinstance(lr, (float, np.float32, np.float64))):
        raise ValueError('The output of the "schedule" function should be float.')
    if (lr != self.prev_lr):
        self.model.optimizer.learning_rate = lr
        self.prev_lr = lr
        tf.compat.v1.logging.debug('Epoch %05d Batch %05d: LearningRateBatchScheduler change learning rate to %s.', self.epochs, batch, lr)
Executes before step begins.
def on_batch_begin(self, batch, logs=None):
    
    lr = self.schedule(self.epochs, batch, self.steps_per_epoch, self.batch_size)
    if (not isinstance(lr, (float, np.float32, np.float64))):
        raise ValueError('The output of the "schedule" function should be float.')
    if (lr != self.prev_lr):
        self.model.optimizer.learning_rate = lr
        self.prev_lr = lr
        tf.compat.v1.logging.debug('Epoch %05d Batch %05d: LearningRateBatchScheduler change learning rate to %s.', self.epochs, batch, lr)