WWDC 2017
Session video and resources: https://developer.apple.com/videos/play/wwdc2017/710/
- Use case: Sentiment analysis app which gives mood output according to the text input
- Use NLP (
NSLinguisticTagger
) -> Get Word count and tokenize -> Feed it to the ML model
- Task: Next word prediction
- Sequence of words -> Model -> Next word choices & state
- Next word & state is fed into the model recursively
- Core ML uses Accelerate on top of CPU and Metal on top of GPU
- Example models under https://developer.apple.com/machine-learning
- Fully open sourced
- Model Source (e.g Caffe) -> Xcode -> ML Model & Swift ->
pip install coremltools
- Convert from other formats
- Build your own converter
- Compatible & Extensible
Sample python code
import coremltools
caffe_model = ('flowers.caffemodel', 'flowers.prototxt')
labels = 'labels.txt'
coreml_model = coremltools.converters.caffe.convert(caffe_model, class_labels=labels, image_input_names='data')
coreml_model
// Output of dictionaries with the results
coreml_model.save('FlowerPredictor.mlmodel')
- Easy integration of ML models
- Rich datatype support
- Hardware optimized
- Compatible with popular formats