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
          )
          self.prev_lr = lr
          tf.compat.v1.logging.debug(
              "Epoch %05d Batch %05d: LearningRateBatchScheduler "
              "change learning rate to %s.",
              self.epochs,
              batch,
              lr,
          )
  
imports: import argparse
  import numpy
  import os
  from pathlib import Path
  import tensorflow
  from tensorflow.keras.callbacks import Callback, ModelCheckpoint
  from tensorflow.keras.initializers import RandomNormal
  from tensorflow.keras.layers import Activation, Add, BatchNormalization, Conv2D, Dense, Input, ZeroPadding2D
  from tensorflow.keras.models import Model
  from tensorflow.keras.optimizers import SGD
  from tensorflow.keras.preprocessing.image import ImageDataGenerator
  from tensorflow.keras.regularizers import l2
  from typing import Callable, Tuple, Union
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