code: def on_batch_end(self, batch, logs={}):
      if batch % self.print_every_n_batches == 0:
          z_new = np.random.normal(size=(1, self.vae.z_dim))
          reconst = self.vae.decoder.predict(np.array(z_new))[
              0
          ].squeeze()
  
          filepath = os.path.join(
              self.run_folder,
              "images",
              "img_"
              + str(self.epoch).zfill(3)
              + "_"
              + str(batch)
              + ".jpg",
          )
          if len(reconst.shape) == 2:
              plt.imsave(filepath, reconst, cmap="gray_r")
          else:
              plt.imsave(filepath, reconst)
  
file_path: autoencoder-gelu/utils/callbacks.py
imports: from keras.callbacks import Callback, LearningRateScheduler
  import numpy
  import matplotlib.pyplot
  import os
label_desc: Use image node_id 2 for calling the CustomCallback obj's underlying member method code with example usage: obj.on_batch_end(batch, logs) without return types