def on_epoch_end(self, epoch, logs=None):
    logs = (logs or {})
    logs['lr'] = K.get_value(self.model.optimizer.lr)
    self.trn_iterations += 1
    self.cycle_iterations += 1
    if (self.cycle_iterations >= (self.base_epochs * (self.mul_epochs ** self.cycles))):
        self.cycles += 1
        self.cycle_iterations = 0
        K.set_value(self.model.optimizer.lr, self.max_lr)
    else:
        K.set_value(self.model.optimizer.lr, self.sgdr())
def on_epoch_end(self, epoch, logs=None):
    logs = (logs or {})
    logs['lr'] = K.get_value(self.model.optimizer.lr)
    self.trn_iterations += 1
    self.cycle_iterations += 1
    if (self.cycle_iterations >= (self.base_epochs * (self.mul_epochs ** self.cycles))):
        self.cycles += 1
        self.cycle_iterations = 0
        K.set_value(self.model.optimizer.lr, self.max_lr)
    else:
        K.set_value(self.model.optimizer.lr, self.sgdr())