This respository contains the example code for the blog post Nearest Neighbors with Keras and CoreML.
The example notebook shows how you can use Keras to build a cosine-based k-nearest neighbors model (k-NN) on top of an existing deep network. The notebook also has an example of converting the model to CoreML for use on iPhone or other iOS devices.