class_docstr: The loss 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,
      loss_kwargs: Mapping[str, Any],
      loss_kwargs_with_lambda_weight: Mapping[str, Any],
      gbl_loss_kwargs: Mapping[str, Any],
  ) -> Dict[str, Tuple[Callable[..., tf.Tensor], Dict[str, Any]]]:
      """Builds the mapping from loss keys to loss functions."""
  
      key_to_fn = {
          RankingLossKey.PAIRWISE_HINGE_LOSS: (
              _pairwise_hinge_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.PAIRWISE_LOGISTIC_LOSS: (
              _pairwise_logistic_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.PAIRWISE_SOFT_ZERO_ONE_LOSS: (
              _pairwise_soft_zero_one_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.PAIRWISE_MSE_LOSS: (
              _pairwise_mse_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.YETI_LOGISTIC_LOSS: (
              _pairwise_logistic_loss,
              gbl_loss_kwargs,
          ),
          RankingLossKey.CIRCLE_LOSS: (
              _circle_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.SOFTMAX_LOSS: (
              _softmax_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.POLY_ONE_SOFTMAX_LOSS: (
              _poly_one_softmax_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.UNIQUE_SOFTMAX_LOSS: (
              _unique_softmax_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.SIGMOID_CROSS_ENTROPY_LOSS: (
              _sigmoid_cross_entropy_loss,
              loss_kwargs,
          ),
          RankingLossKey.MEAN_SQUARED_LOSS: (
              _mean_squared_loss,
              loss_kwargs,
          ),
          RankingLossKey.LIST_MLE_LOSS: (
              _list_mle_loss,
              loss_kwargs_with_lambda_weight,
          ),
          RankingLossKey.APPROX_NDCG_LOSS: (
              _approx_ndcg_loss,
              loss_kwargs,
          ),
          RankingLossKey.APPROX_MRR_LOSS: (
              _approx_mrr_loss,
              loss_kwargs,
          ),
          RankingLossKey.GUMBEL_APPROX_NDCG_LOSS: (
              _approx_ndcg_loss,
              gbl_loss_kwargs,
          ),
          RankingLossKey.NEURAL_SORT_CROSS_ENTROPY_LOSS: (
              _neural_sort_cross_entropy_loss,
              loss_kwargs,
          ),
          RankingLossKey.GUMBEL_NEURAL_SORT_CROSS_ENTROPY_LOSS: (
              _neural_sort_cross_entropy_loss,
              gbl_loss_kwargs,
          ),
          RankingLossKey.NEURAL_SORT_NDCG_LOSS: (
              _neural_sort_ndcg_loss,
              loss_kwargs,
          ),
          RankingLossKey.GUMBEL_NEURAL_SORT_NDCG_LOSS: (
              _neural_sort_ndcg_loss,
              gbl_loss_kwargs,
          ),
      }
  
      return key_to_fn
  
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 _LossFunctionMaker obj's underlying member method code with example usage: obj.build_key_to_loss_fn_mapping(loss_kwargs, loss_kwargs_with_lambda_weight, gbl_loss_kwargs) and returns: key_to_fn