def _softmax_ranknet(): pairwise_predicted_scores = scores.get_softmax_pairwise_scores(predicted_scores) pairwise_label_scores = scores.get_pairwise_label_scores(labels) loss = loss_fns.get_pair_loss(pairwise_label_scores, pairwise_predicted_scores, params) return loss
def _lambdarank(): pairwise_predicted_scores = scores.get_pairwise_scores(predicted_scores) pairwise_label_scores = scores.get_pairwise_label_scores(labels) n_data = tf.shape(labels)[0] swapped_ndcg = math_fns.cal_swapped_ndcg(labels, predicted_scores, top_k_int=n_data) loss = loss_fns.get_lambda_pair_loss(pairwise_label_scores, pairwise_predicted_scores, params, swapped_ndcg) return loss
def _ranksvm(): pairwise_predicted_scores = scores.get_pairwise_scores( predicted_scores) pairwise_label_scores = scores.get_pairwise_label_scores(labels) return loss_fns.get_hinge_loss(pairwise_label_scores, pairwise_predicted_scores, params)