AI and Machine Learning for On-Device Development by Laurence Moroney

AI and Machine Learning for On-Device Development by Laurence Moroney

Author:Laurence Moroney [Laurence Moroney]
Language: eng
Format: epub, azw3, pdf
Publisher: O'Reilly Media, Inc.
Published: 2021-08-17T16:00:00+00:00


let results = [Float32](unsafeData: outputTensor.data) ?? []

As you can see, although this is a more complex example, the same design pattern holds. You must understand your model’s architecture, and the raw input and output formats. You must then structure your input data in the way the model expects—which often means getting down to raw bytes that you write into a buffer, or at least simulate using an array. You then have to read the raw stream of bytes coming out of the model and create a data structure to hold them. From the output perspective, this will almost always be something like we’ve seen in this chapter—an array of floats. With the helper code you’ve implemented, you’re most of the way there!

We’ll look into this example in more detail in Chapter 11.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.