Closed BerenLuthien closed 4 years ago
As you can see it's implemented but not used in the notebooks, the visualizations look better without it. It should be beneficial to use it though (the margin value must be adjusted then)
Hello (sorry for late response), 1, any recommendation of margin for EmbeddingNetL2 (and why) ? I remember the Facenet paper used margin=0.2
2, replacing with EmbeddingNetL2 gives Error :
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [128, 128]], which is output 0 of AddmmBackward, is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
Did you ever try it and any luck of success ? I got a fix, would you be interested in a PR ? Thanks
output = output / ...
instead of output /= ...
Thanks for sharing great work
Whether embedding is normalized ||x||=1 ? It looks EmbeddingNetL2 adopted normalization of embedding, but it is not used. From ReadMe it is EmbeddingNet that is adopted but it does not normalize embeddings.