code: def __create_distributed_optimizer(
      self,
      training_rdd,
      batch_size=32,
      nb_epoch=10,
      validation_data=None,
  ):
      sc = get_spark_context()
      bopt = boptimizer.Optimizer(
          model=self.bmodel,
          training_rdd=training_rdd,
          criterion=self.criterion,
          end_trigger=boptimizer.MaxEpoch(nb_epoch),
          batch_size=batch_size,
          optim_method=self.optim_method,
      )
      if validation_data:
          bopt.set_validation(
              batch_size,
              val_rdd=validation_data,
              # TODO: check if keras use the same strategy
              trigger=boptimizer.EveryEpoch(),
              val_method=self.metrics,
          )
      return bopt
  
file_path: BigDL/python/dllib/src/bigdl/dllib/nn/keras/backend.py
imports: from bigdl.dllib.nn.keras.optimization import *
  from bigdl.dllib.utils.common import *
label_desc: Use image node_id 7 for calling the KerasModelWrapper obj's underlying member method code with example usage: obj.__create_distributed_optimizer(training_rdd, batch_size, nb_epoch, validation_data) and returns: bopt