class_docstr_tok: []
code: def on_train_end(self, logs={}):
      if self.predictions != []:
          if self.epoch_prediction_output_mode == "gif":
              if type(self.predictions[0]) is list:
                  for output in range(len(self.predictions[0])):
                      current_predictions = [
                          item[output] for item in self.predictions
                      ]
                      imageio.mimsave(
                          os.path.join(
                              self.epoch_prediction_dir,
                              "epoch_prediction_"
                              + str(output)
                              + ".gif",
                          ),
                          current_predictions,
                      )
              else:
                  imageio.mimsave(
                      os.path.join(
                          self.epoch_prediction_dir,
                          "epoch_prediction.gif",
                      ),
                      self.predictions,
                  )
  
          elif self.epoch_prediction_output_mode == "mosaic":
              raise NotImplementedError(
                  "Training callback mosaics are not yet implemented. (epoch_prediction_output_mode = 'mosaic'"
              )
  
              if type(self.predictions[0]) is list:
                  for output in range(len(self.predictions[0])):
                      current_predictions = [
                          item[output] for item in self.predictions
                      ]
                      prediction_array = np.array(current_predictions)
                      check_data(
                          {"Training Progress": prediction_array},
                          show_output=True,
                          **self.kwargs,
                      )
                      print(prediction_array.shape)
                      # imageio.mimsave(os.path.join(self.epoch_prediction_dir, 'epoch_prediction_' + str(output) + '.gif'), current_predictions)
              else:
                  output_mosaic = np.array(self.predictions)
                  print(output_mosaic.shape)
  
          else:
              raise NotImplementedError
  
      return
  
imports: import os
  import imageio
  import numpy
  from keras.callbacks import ModelCheckpoint, EarlyStopping, CSVLogger, Callback
  from keras import backend
  from deepneuro.utilities.util import add_parameter
  from deepneuro.utilities.visualize import check_data
label_desc: Use image node_id 2 for calling the EpochPredict obj's underlying member method code with example usage: obj.on_train_end(logs) without return types