class_docstr: Callback to update learning rate on every batch (not epoch boundaries).
  
  N.B. Only support Keras optimizers, not TF optimizers.
  
  Attributes:
      schedule: a function that takes an epoch index and a batch index as input
          (both integer, indexed from 0) and returns a new learning rate as
          output (float).
class_docstr_tok: ["Callback","to","update","learning","rate","on","every","batch","(","not","epoch","boundaries",")",".","N.B",".","Only","support","Keras","optimizers",",","not","TF","optimizers",".","Attributes",":","schedule",":","a","function","that","takes","an","epoch","index","and","a","batch","index","as","input","(","both","integer",",","indexed","from","0",")","and","returns","a","new","learning","rate","as","output","(","float",")","."]
docstr: Executes before step begins.
docstr_tok: ["Executes","before","step","begins","."]
code: 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  # lr should be a float here
          )
          self.prev_lr = lr
          logging.debug(
              "Epoch %05d Batch %05d: LearningRateBatchScheduler "
              "change learning rate to %s.",
              self.epochs,
              batch,
              lr,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import app
  from absl import flags
  from absl import logging
  import numpy
  import tensorflow
  from official.benchmark.models import cifar_preprocessing
  from official.benchmark.models import resnet_cifar_model
  from official.benchmark.models import synthetic_util
  from official.utils.flags import core
  from official.utils.misc import distribution_utils
  from official.utils.misc import keras_utils
  from official.vision.image_classification.resnet import common
label_desc: Use image node_id 3 for calling the LearningRateBatchScheduler obj's underlying member method code with example usage: obj.on_batch_begin(batch, logs) without return types