code: def to_bigdl_criterion(kloss):
      if isinstance(kloss, six.string_types):
          kloss = kloss.lower()
      if (
          kloss == "categorical_crossentropy"
          or kloss == categorical_crossentropy
      ):
          return bcriterion.CategoricalCrossEntropy()
      elif (
          kloss == "mse"
          or kloss == "mean_squared_error"
          or kloss == mse
      ):
          return bcriterion.MSECriterion()
      elif (
          kloss == "binary_crossentropy" or kloss == binary_crossentropy
      ):
          return bcriterion.BCECriterion()
      elif (
          kloss == "mae"
          or kloss == "mean_absolute_error"
          or kloss == mae
      ):
          return bcriterion.AbsCriterion()
      elif kloss == "hinge" or kloss == hinge:
          return bcriterion.MarginCriterion()
      elif (
          kloss == "mean_absolute_percentage_error"
          or kloss == "mape"
          or kloss == mean_absolute_percentage_error
      ):
          return bcriterion.MeanAbsolutePercentageCriterion()
      elif (
          kloss == "mean_squared_logarithmic_error"
          or kloss == "msle"
          or kloss == mean_squared_logarithmic_error
      ):
          return bcriterion.MeanSquaredLogarithmicCriterion()
      elif kloss == "squared_hinge" or kloss == squared_hinge:
          return bcriterion.MarginCriterion(squared=True)
      elif (
          kloss == "sparse_categorical_crossentropy"
          or kloss == sparse_categorical_crossentropy
      ):
          return bcriterion.ClassNLLCriterion(logProbAsInput=False)
      elif (
          kloss == "kullback_leibler_divergence"
          or kloss == "kld"
          or kloss == kullback_leibler_divergence
      ):
          return bcriterion.KullbackLeiblerDivergenceCriterion()
      elif kloss == "poisson" or kloss == poisson:
          return bcriterion.PoissonCriterion()
      elif (
          kloss == "cosine_proximity"
          or kloss == "cosine"
          or kloss == cosine_proximity
      ):
          return bcriterion.CosineProximityCriterion()
      else:
          invalidInputError(False, "Not supported loss: %s" % kloss)
  
file_path: BigDL/python/dllib/src/bigdl/dllib/nn/keras/optimization.py
imports: import keras.optimizers
  import bigdl.dllib.nn.criterion
  import bigdl.dllib.optim.optimizer
  from bigdl.dllib.utils.common import to_list
  from bigdl.dllib.keras.converter import *
  from keras.objectives import *
  import six
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 2 for calling the OptimConverter obj's underlying member method code with example usage: obj.to_bigdl_criterion(kloss) and returns: bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion, bcriterion