class_docstr: Pipleine for single-task training.
  
  This handles a single loss and works with `SimpleDatasetBuilder`. This can
  also work with `MultiLabelDatasetBuilder`. In this case, the same loss, as
  well as all metrics, will be applied to all labels and their predictions
  uniformly.
  
  Use subclassing to customize the loss and metrics.
  
  Example usage:
  
  ```python
  context_feature_spec = {}
  example_feature_spec = {
      "example_feature_1": tf.io.FixedLenFeature(
          shape=(1,), dtype=tf.float32, default_value=0.0)
  }
  mask_feature_name = "list_mask"
  label_spec = {
      "utility": tf.io.FixedLenFeature(
          shape=(1,), dtype=tf.float32, default_value=0.0)
  }
  dataset_hparams = DatasetHparams(
      train_input_pattern="train.dat",
      valid_input_pattern="valid.dat",
      train_batch_size=128,
      valid_batch_size=128)
  pipeline_hparams = pipeline.PipelineHparams(
      model_dir="model/",
      num_epochs=2,
      steps_per_epoch=5,
      validation_steps=2,
      learning_rate=0.01,
      loss="softmax_loss")
  model_builder = SimpleModelBuilder(
      context_feature_spec, example_feature_spec, mask_feature_name)
  dataset_builder = SimpleDatasetBuilder(
      context_feature_spec,
      example_feature_spec,
      mask_feature_name,
      label_spec,
      dataset_hparams)
  pipeline = SimplePipeline(model_builder, dataset_builder, pipeline_hparams)
  pipeline.train_and_validate(verbose=1)
  ```
class_docstr_tok: ["Pipleine","for","single-task","training",".","This","handles","a","single","loss","and","works","with","`","SimpleDatasetBuilder","`",".","This","can","also","work","with","`","MultiLabelDatasetBuilder","`",".","In","this","case",",","the","same","loss",",","as","well","as","all","metrics",",","will","be","applied","to","all","labels","and","their","predictions","uniformly",".","Use","subclassing","to","customize","the","loss","and","metrics",".","Example","usage",":","``","`","python","context_feature_spec","=","{","}","example_feature_spec","=","{","``","example_feature_1","''",":","tf.io.FixedLenFeature","(","shape=","(","1",",",")",",","dtype=tf.float32",",","default_value=0.0",")","}","mask_feature_name","=","``","list_mask","''","label_spec","=","{","``","utility","''",":","tf.io.FixedLenFeature","(","shape=","(","1",",",")",",","dtype=tf.float32",",","default_value=0.0",")","}","dataset_hparams","=","DatasetHparams","(","train_input_pattern=","''","train.dat","''",",","valid_input_pattern=","''","valid.dat","''",",","train_batch_size=128",",","valid_batch_size=128",")","pipeline_hparams","=","pipeline.PipelineHparams","(","model_dir=","''","model\/","''",",","num_epochs=2",",","steps_per_epoch=5",",","validation_steps=2",",","learning_rate=0.01",",","loss=","''","softmax_loss","''",")","model_builder","=","SimpleModelBuilder","(","context_feature_spec",",","example_feature_spec",",","mask_feature_name",")","dataset_builder","=","SimpleDatasetBuilder","(","context_feature_spec",",","example_feature_spec",",","mask_feature_name",",","label_spec",",","dataset_hparams",")","pipeline","=","SimplePipeline","(","model_builder",",","dataset_builder",",","pipeline_hparams",")","pipeline.train_and_validate","(","verbose=1",")","``","`"]
docstr: See `AbstractPipeline`.
code: def build_metrics(self) -> List[tf.keras.metrics.Metric]:
      """See `AbstractPipeline`."""
      eval_metrics = [
          _get_metric(
              "metric/", metrics.RankingMetricKey.NDCG, topn=topn
          )
          for topn in [1, 5, 10, None]
      ]
      return eval_metrics
  
imports: import abc
  import dataclasses
  import os
  from typing import Any, Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow_ranking.python import data
  from tensorflow_ranking.python.keras import losses
  from tensorflow_ranking.python.keras import metrics
  from tensorflow_ranking.python.keras import model
  from tensorflow_ranking.python.keras import saved_model
  from tensorflow_ranking.python.keras import strategy_utils
label_desc: Use image node_id 2 for calling the SimplePipeline obj's underlying member method code with example usage: obj.build_metrics() and returns: eval_metrics