If I understand this NIPS 2017 paper 3 (Multiscale Quantization for Fast Similarity Search) correctly, it has some sort of nearest neighbor search (Eq. 2) and claims to be training the model using SGD.