hash2GloVe_test.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:hash2vec 作者: Roj 项目源码 文件源码
def distance(a,b):
    return scipy.spatial.distance.cosine(a,b) # ya incluye el 1-cos(ab)
    #return sum(pow(a[i]-b[i],2) for i in range(len(b))) #euclidean norm
    #pearson correlation in negative so lower is better
    #return 1- dot(norm(a),norm(b))
    #tanimoto distance
    #return 1 - dot(a,b)/(dot(a,a) + dot(b,b) - dot(a,b))
    #return sci.kendalltau(a,b) #kendall tau



# Load the benchmark
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号