Learning to Hash with Binary Reconstructive Embeddings