Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 1.92 KB

Core_ML_in_Depth.md

File metadata and controls

60 lines (51 loc) · 1.92 KB

WWDC 2017

Table of Contents

Core ML in Depth - Thursday

Session video and resources: https://developer.apple.com/videos/play/wwdc2017/710/

Sentimental Analysis

  • 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

Predictive Keyboard

  • Task: Next word prediction
  • Sequence of words -> Model -> Next word choices & state
    • Next word & state is fed into the model recursively

Hardware Optimized

  • Core ML uses Accelerate on top of CPU and Metal on top of GPU

Deploying Core ML Models

Core ML Tools

  • Fully open sourced

Conversion Workflow

  • Model Source (e.g Caffe) -> Xcode -> ML Model & Swift ->
  • pip install coremltools

What's CoreML Tools

  • Convert from other formats
  • Build your own converter
  • Compatible & Extensible

Conversion Demo

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')

Summary

  • Easy integration of ML models
  • Rich datatype support
  • Hardware optimized
  • Compatible with popular formats