Skip to Main Content
Machine Learning with Core ML
book

Machine Learning with Core ML

by Joshua Newnham
June 2018
Intermediate to advanced content levelIntermediate to advanced
378 pages
8h 43m
English
Packt Publishing
Content preview from Machine Learning with Core ML

Taking advantage of the GPU 

You may recall that when we introduced the MLCustomLayer protocol, there was an optional method, encode(commandBuffer, inputs, outputs), reserved for performing the evaluation on the GPU if the hosting device supported it. This flexibility is one of the advantages Core ML has over other machine learning frameworks; it allows mixing layers, which run on the CPU and GPU, and allows them to work coherently together. 

To use the GPU, we will be using Apple's Metal framework, a graphics framework equivalent to OpenGL and DirectX (and now Vulkan), for those who are familiar with 3D graphics. Unlike our previous solutions, which included all code in a single method, we need to write the code that performs the computation ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Machine Learning with ML.NET

Hands-On Machine Learning with ML.NET

Jarred Capellman

Publisher Resources

ISBN: 9781788838290Supplemental Content