modules/evaluate.py
def evaluate(logits, targets, k=20):
    """ Evaluates the model using Recall@K, MRR@K scores.

    Args:
        logits (B,C): torch.LongTensor. The predicted logit for the next items.
        targets (B): torch.LongTensor. actual target indices.

    Returns:
        recall (float): the recall score
        mrr (float): the mrr score
    """
    _, indices = torch.topk(logits, k, -1)
    recall = get_recall(indices, targets)
    mrr = get_mrr(indices, targets)

    return recall, mrr
 Evaluates the model using Recall@K, MRR@K scores.

    Args:
        logits (B,C): torch.LongTensor. The predicted logit for the next items.
        targets (B): torch.LongTensor. actual target indices.

    Returns:
        recall (float): the recall score
        mrr (float): the mrr score
    
Evaluates the model using Recall@K, MRR@K scores.
Evaluates the model using Recall@K MRR@K scores .
def evaluate(logits, targets, k=20):
    _, indices = torch.topk(logits, k, -1)
    recall = get_recall(indices, targets)
    mrr = get_mrr(indices, targets)
    return recall, mrr
def evaluate ( logits , targets , k = 20 ) : _ , indices = torch . topk ( logits , k , - 1 ) recall = get_recall ( indices , targets ) mrr = get_mrr ( indices , targets ) return recall , mrr
Evaluates the model using Recall@K, MRR@K scores.
Evaluates the model using Recall@K MRR@K scores .
""" Evaluates the model using Recall@K, MRR@K scores.

    Args:
        logits (B,C): torch.LongTensor. The predicted logit for the next items.
        targets (B): torch.LongTensor. actual target indices.

    Returns:
        recall (float): the recall score
        mrr (float): the mrr score
    """
recall (float): the recall score
mrr (float): the mrr score
recall ( float ) : the recall score mrr ( float ) : the mrr score
logits
torch.LongTensor. The predicted logit for the next items.
torch . LongTensor . The predicted logit for the next items .
targets
torch.LongTensor. actual target indices.
torch . LongTensor . actual target indices .
k