Introduction

Cloud-based machine learning and language model platforms, such as ChatGPT, get most of the attention. However, using a model directly on your device can provide a better solution for many situations. Keeping the data on the user’s device preserves your user’s privacy and eliminates concerns about bandwidth and the delays inherent to sending data to a third party and waiting for a reply. In many cases, licensing or training a model for your app can be cheaper than repeated calls by your users to a vendor and also provides a consistent and known cost compared to the uncertainty of cloud API calls charged by the request.

You’ll soon run into the issue that most research around machine learning uses libraries and platforms built around the Python language. While a robust and popular language, Python isn’t the language of choice for Apple platform development. Apple developed the Core ML framework to facilitate machine learning on Apple platforms which is built around Swift.

Fortunately, Apple provides a set of tools to let you convert models built on these other platforms into Core ML for use in your apps. This lesson will discuss two popular model formats, TensorFlow and PyTorch, and how they differ from CoreML. You’ll then install a Python environment along with Apple’s Core ML Tools. You’ll use those tools to download a vision-based machine learning framework and convert its PyTorch model to Core ML before integrating the new CoreML model into an iOS app.

By the ending of this lesson, you will have learned to:

  • Identify popular third-party model formats (e.g., TensorFlow, PyTorch).

  • Describe installing CoreML tools and necessary libraries.

See forum comments
Download course materials from Github
Next: Instruction