class_docstr: The loss metric function maker.
docstr: Builds the mapping from loss keys to loss functions.
docstr_tok: ["Builds","the","mapping","from","loss","keys","to","loss","functions","."]
code: def build_key_to_loss_fn_mapping(
      self,
      name: Optional[str],
      lambda_weight: Optional[losses_impl._LambdaWeight],
  ) -> Dict[str, losses_impl._RankingLoss]:
      """Builds the mapping from loss keys to loss functions."""
      metric_dict = {
          RankingLossKey.PAIRWISE_HINGE_LOSS: losses_impl.PairwiseHingeLoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.PAIRWISE_LOGISTIC_LOSS: losses_impl.PairwiseLogisticLoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.PAIRWISE_SOFT_ZERO_ONE_LOSS: losses_impl.PairwiseSoftZeroOneLoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.PAIRWISE_MSE_LOSS: losses_impl.PairwiseMSELoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.CIRCLE_LOSS: losses_impl.CircleLoss(name),
          RankingLossKey.SOFTMAX_LOSS: losses_impl.SoftmaxLoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.POLY_ONE_SOFTMAX_LOSS: losses_impl.PolyOneSoftmaxLoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.UNIQUE_SOFTMAX_LOSS: losses_impl.UniqueSoftmaxLoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.SIGMOID_CROSS_ENTROPY_LOSS: losses_impl.SigmoidCrossEntropyLoss(
              name
          ),
          RankingLossKey.MEAN_SQUARED_LOSS: losses_impl.MeanSquaredLoss(
              name
          ),
          RankingLossKey.LIST_MLE_LOSS: losses_impl.ListMLELoss(
              name, lambda_weight=lambda_weight
          ),
          RankingLossKey.APPROX_NDCG_LOSS: losses_impl.ApproxNDCGLoss(
              name
          ),
          RankingLossKey.APPROX_MRR_LOSS: losses_impl.ApproxMRRLoss(
              name
          ),
          RankingLossKey.GUMBEL_APPROX_NDCG_LOSS: losses_impl.ApproxNDCGLoss(
              name
          ),
          RankingLossKey.NEURAL_SORT_CROSS_ENTROPY_LOSS: losses_impl.NeuralSortCrossEntropyLoss(
              name
          ),
          RankingLossKey.GUMBEL_NEURAL_SORT_CROSS_ENTROPY_LOSS: losses_impl.NeuralSortCrossEntropyLoss(
              name
          ),
          RankingLossKey.NEURAL_SORT_NDCG_LOSS: losses_impl.NeuralSortNDCGLoss(
              name
          ),
          RankingLossKey.GUMBEL_NEURAL_SORT_NDCG_LOSS: losses_impl.NeuralSortNDCGLoss(
              name
          ),
      }
      return metric_dict
  
imports: from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union
  import tensorflow
  from tensorflow_ranking.python import losses_impl
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 2 for calling the _LossMetricFunctionMaker obj's underlying member method code with example usage: obj.build_key_to_loss_fn_mapping(name, lambda_weight) and returns: metric_dict