Closed lzg188 closed 6 years ago
As we just need a threshold
i don't understand what's your meaning. but the cosine distance will get the better acc on lfw than euclidean metric ? and because our loss is based the angle,so i think the cosine distance is more appropriate. sphereface 's github use cosine distance. waiting for your reply!
the feature has been normalized, so euclidean metric actually plays equal to cos distance
||A-B||^2 = ||A||^2+||B||^2-2*dot(A,B) = 2-2 cos(A,B) if ||A||^2 = 1 & ||B||^2 = 1 for A,B belongs to R^n
great thanks very much this can be closed
we can see the following function。
def calculate_val(thresholds, embeddings1, embeddings2, actual_issame, far_target, nrof_folds=10): assert(embeddings1.shape[0] == embeddings2.shape[0]) assert(embeddings1.shape[1] == embeddings2.shape[1]) nrof_pairs = min(len(actual_issame), embeddings1.shape[0]) nrof_thresholds = len(thresholds) k_fold = LFold(n_splits=nrof_folds, shuffle=False)
waiting for your reply!