code: def to_bigdl_metric(metric):
      metric = metric.lower()
      if metric == "accuracy" or metric == "acc":
          return zmetrics.Accuracy()
      elif metric == "top5accuracy" or metric == "top5acc":
          return zmetrics.Top5Accuracy()
      elif metric == "mae":
          from bigdl.optim.optimizer import MAE
  
          return MAE()
      elif metric == "auc":
          return zmetrics.AUC()
      elif metric == "treennaccuracy":
          from bigdl.optim.optimizer import TreeNNAccuracy
  
          return TreeNNAccuracy()
      else:
          raise TypeError("Unsupported metric: %s" % metric)
  
imports: from zoo.tfpark.tfnet import TFNet
  from zoo.tfpark.tf_optimizer import BigDLMetric, TFModel
  from zoo.pipeline.api.keras import metrics
label_desc: Use image node_id 1 for calling a global function with example usage: to_bigdl_metric(metric) and returns: zmetrics, zmetrics, MAE, zmetrics, TreeNNAccuracy