Book Image

Machine Learning with Core ML

Book Image

Machine Learning with Core ML

Overview of this book

Core ML is a popular framework by Apple, with APIs designed to support various machine learning tasks. It allows you to train your machine learning models and then integrate them into your iOS apps. Machine Learning with Core ML is a fun and practical guide that not only demystifies Core ML but also sheds light on machine learning. In this book, you’ll walk through realistic and interesting examples of machine learning in the context of mobile platforms (specifically iOS). You’ll learn to implement Core ML for visual-based applications using the principles of transfer learning and neural networks. Having got to grips with the basics, you’ll discover a series of seven examples, each providing a new use-case that uncovers how machine learning can be applied along with the related concepts. By the end of the book, you will have the skills required to put machine learning to work in their own applications, using the Core ML APIs
Table of Contents (16 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Transferring style from one image to another 


Imagine being able to have one of the greatest painters in history, such as Vincent van Gogh or Pablo Picasso, recreate a photo of your liking using their own unique style. In a nutshell, this is what style transfer allows us to do. Quite simply, it's the process of generating a photo using the style of one with the content of another, as shown here:

In this section, we will describe, albeit at a high level, how this works and then move on to an alternative that allows us to perform a similar process in significantly less time.

Note

I encourage you to read the original paper, A Neural Algorithm of Artistic Style, by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge, for a more comprehensive overview. This paper is available at https://arxiv.org/abs/1508.06576.

At this stage, we have learned that neural networks learn by iteratively reducing a loss, calculated using some specified cost function that is to indicate how well the neural network...