class_docstr: Defines commonalities between all masked self-supervised models.
class_docstr_tok: ["Defines","commonalities","between","all","masked","self-supervised","models","."]
docstr: Returns a callable metric function for the model.
  
  By default, we return the same metric for each split.
  
  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(predictions, batch)```
docstr_tok: ["Returns","a","callable","metric","function","for","the","model",".","By","default",",","we","return","the","same","metric","for","each","split",".","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","(","predictions",",","batch",")","``","`"]
code: def get_metrics_fn(
      self, split: Optional[str] = None
  ) -> base_model.MetricFn:
      """Returns a callable metric function for the model.
  
      By default, we return the same metric for each split.
  
      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(predictions, batch)```
      """
  
      del split  # Same function for all splits.
      return functools.partial(
          feature_regression_metrics_function,
          feature_target=self.config.masked_feature_loss.target,
          metrics=_REGRESSION_METRICS,
      )
  
file_path: scenic/scenic/projects/av_mae/base_model.py
imports: import functools
  from typing import Dict, Optional, Tuple, Union
  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 model_utils
  from scenic.model_lib.base_models import regression_model
  from scenic.model_lib.layers import nn_ops
label_desc: Use image node_id 2 for calling the MaskedFeatureRegressionModel obj's underlying member method code with example usage: obj.get_metrics_fn(split) and returns: functools