def ppr2(target, cand):
    alpha2 = cand['alpha2']
    beta2 = cand['beta2']
    X = target['X']
    Z = target['Z']
    scores = alpha2.unsqueeze(1) @ X.T @ Z @ beta2.unsqueeze(2)
    scores = scores.squeeze().cpu().detach().numpy()
    return scores

def get_simlarity(name):
    if name == 'ppr2':
        return ppr2