parameters: (identifier)
docstring: Retrieves a Keras metric as a `function`/`Metric` class instance.
  
    The `identifier` may be the string name of a metric function or class.
  
    >>> metric = tf.keras.metrics.get("categorical_crossentropy")
    >>> type(metric)
    <class 'function'>
    >>> metric = tf.keras.metrics.get("CategoricalCrossentropy")
    >>> type(metric)
    <class '...keras.metrics.CategoricalCrossentropy'>
  
    You can also specify `config` of the metric to this function by passing dict
    containing `class_name` and `config` as an identifier. Also note that the
    `class_name` must map to a `Metric` class
  
    >>> identifier = {"class_name": "CategoricalCrossentropy",
    ...               "config": {"from_logits": True}}
    >>> metric = tf.keras.metrics.get(identifier)
    >>> type(metric)
    <class '...keras.metrics.CategoricalCrossentropy'>
  
    Args:
      identifier: A metric identifier. One of None or string name of a metric
        function/class or metric configuration dictionary or a metric function or
        a metric class instance
  
    Returns:
      A Keras metric as a `function`/ `Metric` class instance.
  
    Raises:
      ValueError: If `identifier` cannot be interpreted.
docstring_summary: Retrieves a Keras metric as a `function`/`Metric` class instance.
docstring_tokens: Retrieves a Keras metric as a function / Metric class instance .
function: def get(identifier):
    """Retrieves a Keras metric as a `function`/`Metric` class instance.
  
    The `identifier` may be the string name of a metric function or class.
  
    >>> metric = tf.keras.metrics.get("categorical_crossentropy")
    >>> type(metric)
    <class 'function'>
    >>> metric = tf.keras.metrics.get("CategoricalCrossentropy")
    >>> type(metric)
    <class '...keras.metrics.CategoricalCrossentropy'>
  
    You can also specify `config` of the metric to this function by passing dict
    containing `class_name` and `config` as an identifier. Also note that the
    `class_name` must map to a `Metric` class
  
    >>> identifier = {"class_name": "CategoricalCrossentropy",
    ...               "config": {"from_logits": True}}
    >>> metric = tf.keras.metrics.get(identifier)
    >>> type(metric)
    <class '...keras.metrics.CategoricalCrossentropy'>
  
    Args:
      identifier: A metric identifier. One of None or string name of a metric
        function/class or metric configuration dictionary or a metric function or
        a metric class instance
  
    Returns:
      A Keras metric as a `function`/ `Metric` class instance.
  
    Raises:
      ValueError: If `identifier` cannot be interpreted.
    """
    if isinstance(identifier, dict):
      return deserialize(identifier)
    elif isinstance(identifier, str):
      return deserialize(str(identifier))
    elif callable(identifier):
      return identifier
    else:
      raise ValueError(
          'Could not interpret metric function identifier: {}'.format(identifier))
function_tokens: def get ( identifier ) : if isinstance ( identifier , dict ) : return deserialize ( identifier ) elif isinstance ( identifier , str ) : return deserialize ( str ( identifier ) ) elif callable ( identifier ) : return identifier else : raise ValueError ( 'Could not interpret metric function identifier: {}' . format ( identifier ) )