def l2norm(self, x):
"""
Force embeddings onto a hypershere.
This has been done in
Schroff et al. “FaceNet: A Unified Embedding for Face Recognition and
Clustering.” arXiv:1503.03832 [cs], March 12, 2015.
http://arxiv.org/abs/1503.03832.
However it did not work out for me very well, so this function is
currently not used.
"""
return F.local_response_normalization(x, n=x.data.shape[1]*2,
k=0, alpha=1, beta=0.5)
评论列表
文章目录