def debug_one_row_cosine_similarity(X):
    W = np.zeros((X.shape[0], X.shape[0]))
    W_gt = pairwise_kernels(X, metric='cosine', filter_params=True)
    for (i, row) in enumerate(X):
        W[i] = one_row_cosine_similarity(X, i)
    print(W)
    print(W_gt)
    print(np.sum((W - W_gt)))
def debug_one_row_cosine_similarity(X):
    W = np.zeros((X.shape[0], X.shape[0]))
    W_gt = pairwise_kernels(X, metric='cosine', filter_params=True)
    for (i, row) in enumerate(X):
        W[i] = one_row_cosine_similarity(X, i)
    print(W)
    print(W_gt)
    print(np.sum((W - W_gt)))