docstr: Run the training loop of the this optimizer
  :param end_trigger: BigDL's Trigger to indicate when to stop the training.
  :param checkpoint_trigger: When to save a checkpoint and evaluate model.
docstr_tok: ["Run","the","training","loop","of","the","this","optimizer",":","param","end_trigger",":","BigDL","'s","Trigger","to","indicate","when","to","stop","the","training",".",":","param","checkpoint_trigger",":","When","to","save","a","checkpoint","and","evaluate","model","."]
code: def optimize(self, end_trigger=None, checkpoint_trigger=None):
      """
      Run the training loop of the this optimizer
      :param end_trigger: BigDL's Trigger to indicate when to stop the training.
      :param checkpoint_trigger: When to save a checkpoint and evaluate model.
      """
      if end_trigger is None:
          end_trigger = MaxEpoch(1)
  
      if checkpoint_trigger is None:
          checkpoint_trigger = EveryEpoch()
  
      if isinstance(self.train_data, FeatureSet):
          if self.train_data.value.getNumOfSlice() != 1:
              if isinstance(checkpoint_trigger, EveryEpoch):
                  checkpoint_trigger = ZEveryEpoch()
              elif not isinstance(checkpoint_trigger, ZooTrigger):
                  invalidInputError(
                      False,
                      "Please use a trigger defined in bigdl.dllib.utils.triggers",
                  )
  
      if self.tf_model.val_methods and self.val_data is not None:
          self.estimator.train_minibatch(
              train_set=self.train_data,
              criterion=self.tf_model.criterion,
              end_trigger=end_trigger,
              checkpoint_trigger=checkpoint_trigger,
              validation_set=self.val_data,
              validation_method=self.tf_model.val_methods,
          )
      else:
          self.estimator.train_minibatch(
              train_set=self.train_data,
              criterion=self.tf_model.criterion,
              end_trigger=end_trigger,
              checkpoint_trigger=checkpoint_trigger,
          )
  
      self.tf_model.training_helper_layer.get_weights_to_python()
  
imports: import json
  import logging
  import os
  import sys
  import tempfile
  from bigdl.dllib.nn.criterion import Criterion
  from bigdl.dllib.nn.layer import Layer
  from bigdl.dllib.optim.optimizer import MaxEpoch, EveryEpoch
  from bigdl.dllib.utils.common import to_list, JavaValue
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.feature.common import FeatureSet
  from bigdl.dllib.keras.engine.topology import to_bigdl_metric, Loss, OptimMethod
  from bigdl.dllib.net.utils import find_placeholders, to_bigdl_optim_method, find_tensors
  from bigdl.dllib.estimator.estimator import Estimator
  from bigdl.dllib.utils import nest
  from bigdl.dllib.utils.triggers import EveryEpoch
  from bigdl.dllib.utils.triggers import ZooTrigger
  from bigdl.orca.tfpark.tf_dataset import TFNdarrayDataset, check_data_compatible
  from bigdl.orca.tfpark.tf_dataset import _standarize_feature_label_dataset
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 15 for calling the TFOptimizer obj's underlying member method code with example usage: obj.optimize(end_trigger, checkpoint_trigger) without return types