class_docstr: Abstract class for model with NCR losses.
  
  Supports both softmax-classification and multi-label classification models.
class_docstr_tok: ["Abstract","class","for","model","with","NCR","losses",".","Supports","both","softmax-classification","and","multi-label","classification","models","."]
docstr: Returns a callable metric function for the model.
  
  Args:
    split: The split for which we calculate the metrics. It should be one of
      the ['train',  'validation', 'test'].
  Returns: A metric function with the following API: ```metrics_fn(logits,
    batch)```
docstr_tok: ["Returns","a","callable","metric","function","for","the","model",".","Args",":","split",":","The","split","for","which","we","calculate","the","metrics",".","It","should","be","one","of","the","[","'train","'",",","'validation","'",",","'test","'","]",".","Returns",":","A","metric","function","with","the","following","API",":","``","`","metrics_fn","(","logits",",","batch",")","``","`"]
code: def get_metrics_fn(
      self, split: Optional[str] = None
  ) -> base_model.MetricFn:
      """Returns a callable metric function for the model.
  
      Args:
        split: The split for which we calculate the metrics. It should be one of
          the ['train',  'validation', 'test'].
      Returns: A metric function with the following API: ```metrics_fn(logits,
        batch)```
      """
      del split  # For all splits, we return the same metric functions.
  
      return functools.partial(
          classification_model.classification_metrics_function,
          target_is_onehot=self.dataset_meta_data.get(
              "target_is_onehot", False
          ),
          metrics=_CLASSIFICATION_METRICS,
      )
  
file_path: scenic/scenic/projects/ncr/base_model.py
imports: import functools
  from typing import Dict, Optional, Tuple, Union
  from flax.training import common_utils
  from immutabledict import immutabledict
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import classification_model
  from scenic.model_lib.base_models import model_utils
  from scenic.projects.ncr import loss
label_desc: Use image node_id 4 for calling the NCRModel obj's underlying member method code with example usage: obj.get_metrics_fn(split) and returns: functools