class_docstr: Learning rate scheduler which sets the learning rate according to schedule.
  
  Arguments:
      schedule: a function that takes an epoch index
          (integer, indexed from 0) and current learning rate
          as inputs and returns a new learning rate as output (float).
class_docstr_tok: ["Learning","rate","scheduler","which","sets","the","learning","rate","according","to","schedule",".","Arguments",":","schedule",":","a","function","that","takes","an","epoch","index","(","integer",",","indexed","from","0",")","and","current","learning","rate","as","inputs","and","returns","a","new","learning","rate","as","output","(","float",")","."]
code: def on_epoch_begin(self, epoch, logs=None):
      if not hasattr(self.model.optimizer, "learning_rate"):
          raise ValueError(
              'Optimizer must have a "learning_rate" attribute.'
          )
      # Get the current learning rate from model's optimizer.
      lr = self.model.optimizer.learning_rate
      # Call schedule function to get the scheduled learning rate.
      scheduled_lr = self.schedule(epoch, lr)
      # Set the value back to the optimizer before this epoch starts
      self.model.optimizer.learning_rate = scheduled_lr
      print(
          f"\nEpoch {epoch}: Learning rate is {float(np.array(scheduled_lr))}."
      )
  
imports: import numpy
  import keras
label_desc: Use image node_id 2 for calling the CustomLearningRateScheduler obj's underlying member method code with example usage: obj.on_epoch_begin(epoch, logs) without return types