Open qxzhou1010 opened 4 years ago
这不就是余弦公式么,关键是400是啥意思,哪里来的?
def evaluate(embeddings):
# Calculate evaluation metrics
thresholds = np.arange(0, 4, 0.01)
thresholds = thresholds + 0.01
embeddings1 = embeddings[0]
embeddings2 = embeddings[1]
assert (embeddings1.shape[0] == embeddings2.shape[0])
diff = np.subtract(embeddings1, embeddings2)
dist = np.sum(np.square(diff))
predict_issame = np.less(dist, thresholds)
return np.mean(predict_issame)
这是源码