def cal_hr(predict, ground_truth):
    """
    calculate hit rate
    :param predict: predict, (batch_size, k)
    :param ground_truth: ground truth, (batch_size, )
    :return: hr
    """
    hr = 0
    for i, gt in enumerate(ground_truth):
        if gt in predict[i]:
            hr += 1
    return hr